Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 17 14:14
    vcalmic commented #1042
  • Jan 17 14:14
    vcalmic commented #1042
  • Jan 17 13:40
    vilaemail commented #999
  • Jan 17 11:32
    maknahar commented #1003
  • Jan 16 20:24
    Apollon77 commented #971
  • Jan 16 16:58
    stale[bot] closed #1021
  • Jan 16 16:47
    dfee opened #1048
  • Jan 16 15:25
    Mahmoud-Abd-Alhadi commented #971
  • Jan 16 13:58
    stale[bot] closed #1020
  • Jan 16 12:51
    fbruffaert commented #1007
  • Jan 16 12:50
    fbruffaert commented #1007
  • Jan 15 20:25
    timschlechter commented #941
  • Jan 15 10:19
    stale[bot] labeled #1028
  • Jan 15 10:19
    stale[bot] commented #1028
  • Jan 15 10:16
    ardyfeb opened #1047
  • Jan 15 08:04
    uyu423 edited #1046
  • Jan 15 07:59
    uyu423 opened #1046
  • Jan 14 21:43
    peteclark3 commented #1003
  • Jan 14 21:42
    peteclark3 commented #1003
  • Jan 14 20:53
    peteclark3 commented #1003
Jason Shin
@JasonShin
ok cool
Christian Roy
@roychri
I do not think xE will send the __keyevent@0__:expire event but rather the __keyevent@0__:test event (with the name of your key in the event name).
If you want __keyevent@0__:expire then you should set it to xK I think.
Jason Shin
@JasonShin
I see
Christian Roy
@roychri
But Maybe your right and im mixing them up, tias
Jason Shin
@JasonShin
still, no events
1) "notify-keyspace-events"
2) "xK"
Christian Roy
@roychri
and no events with xE either?
Jason Shin
@JasonShin
nope
I only get a very first
zz null 1 undefined undefined undefined
which means nothing
it's from
redis2.subscribe('__keyevent@0__:expired', (x, y, c, v, b) => {
    console.log('zz', x, y, c, v, b);
  });
^^ testing code
Christian Roy
@roychri
Enable all events (AKE instead of xK) and in another terminal use redis-cli monitor to see the events being sent after you docker-compose restart app...
Jason Shin
@JasonShin
1550539085.729667 [0 192.168.0.3:56496] "info"
1550539085.750826 [0 192.168.0.3:56498] "info"
1550539085.751758 [0 192.168.0.3:56498] "set" "test" "12" "EX" "1"
1550539085.751925 [0 192.168.0.3:56498] "set" "test" "12" "EX" "2"
1550539085.752053 [0 192.168.0.3:56498] "subscribe" "__keyevent@0__:expired"
after that, nothing fires inside the subscribe code
Christian Roy
@roychri
Using redis 2.8.0 or later?
Jason Shin
@JasonShin
yeah
I'm using 5.0.0
Christian Roy
@roychri
I recommend you read this again and see if you missed anything...
https://redis.io/topics/notifications
Jason Shin
@JasonShin
ok I will do that
@roychri a quick question, how do you listen to all these events using cli?
I just want to test this without ioredis
Christian Roy
@roychri
redis-cli monitor will show them I think
Jason Shin
@JasonShin
so when the key expires, what will be logged in redis-cli monitor?
Christian Roy
@roychri
If the notifications are enabled, yes, I think so
Jason Shin
@JasonShin
I've bascially enabled everything notify-keyspace-events AKExes
but still nothing shows up on neither redis-cli monitor and .subscribe('__keyspace@0__:expire', and .subscribe('__keyevent@0__:expire',
Christian Roy
@roychri
AKE would have been enough, since A means all
ok, in another terminal try redis-cli set foo bar and you should see a notification show in monitor
because you have all notificatinos enables, it should fire when the key is set too
Jason Shin
@JasonShin
yup, it shows up
1550540164.681845 [0 127.0.0.1:44188] "set" "foo" "bar"
Christian Roy
@roychri
That's not the event
that's your command
Maybe it does not show up in monitor. Try this:
redis-cli --csv psubscribe '__key*__:*'
Jason Shin
@JasonShin
ohhhhhhhh
it's working
lol
redis.subscribe('__keyevent@0__:expired');
redis.on('message', async (channel, message) => {
    // Handle event
    console.log(channel, message);
  });
Christian Roy
@roychri
oh yeah, that's right. Sorry I did not noticed. I presumed you had read the doc and was using it the way it was described
白一梓
@yunnysunny
If you want to send a batch of commands (e.g. > 5), you can use pipelining to queue the commands in memory and then send them to Redis all at once. This way the performance improves by 50%~300% (See benchmark section).
But where is the benchmark program?
The link has been unreachable.
Achmad Naufal Syafiq
@nooballday

hey suddenly i got this error message Ready check failed: NOAUTH Authentication required, there are few controller that use redis and all of them refer to the same class but this one controller is the only experiencing error,

this is how i setup my ioredis

const redis = new Redis({
port: process.env.REDISPORT, // Redis port
host: process.env.REDISHOST, // Redis host
family: process.env.REDISFAMILY, // 4 (IPv4) or 6 (IPv6)
password: "somepass", // i hardcoded this one
//password: process.env.REDISPASS,
db: 0
})

getRedis() => redis

철정
@rokking1_twitter

Hi. I'm using it really well, but I have a question.

How can I use the mget command on a particular key slot in a cluster environment?

Dharmen Bavaria
@dharmenbavaria
Could someone help me with following thing: I want to use Set function to store key with data to get expired after 24 hours. I would really appreciate if someone could help me with this. I have this function set(key: KeyType, value: any, expiryMode?: string | any[], time?: number | string, setMode?: number | string): Promise<string>; but i dont get her what should expiryMode, time and set model here.
Christian Roy
@roychri

@dharmenbavaria Follow the arguments as defined by redis itself.
If you look at https://redis.io/commands/set
you will see SET key value [expiration EX seconds|PX milliseconds] [NX|XX]

So you would call ioredis like this:
redis.set( 'mykey', 'myvalue', 'EX', (24*60*60) ); (24 hours)

You could also do this:
await redis.set( 'mkey', 'myvalue' );
await redis.expire( 'mykey', (24*60*60) );
Kevin Lee
@cameljava
hi, there, can anyone help on this? I am trying to connect to aws elasticache redis (one master, too rep), cluster mode disabled. should I use new Redis or new Redis.Cluster?