1) "notify-keyspace-events"
2) "xE"
1) "notify-keyspace-events"
2) "xK"
zz null 1 undefined undefined undefined
redis2.subscribe('__keyevent@0__:expired', (x, y, c, v, b) => {
console.log('zz', x, y, c, v, b);
});
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"
5.0.0
redis-cli monitor
and .subscribe('__keyspace@0__:expire',
and .subscribe('__keyevent@0__:expire',
redis-cli set foo bar
and you should see a notification show in monitor
redis-cli --csv psubscribe '__key*__:*'
redis.subscribe('__keyevent@0__:expired');
redis.on('message', async (channel, message) => {
// Handle event
console.log(channel, message);
});
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