I have a shallow key, which is supposed to expire, after listening to its expiration, I take the key, generate the key which holds the real value and try to get its value.
Code:
//.: Set the config for "notify-keyspace-events" channel used for expired type events
listener.send_command('config', ['set','notify-keyspace-events','Ex']);
// __keyevent@0__:expired is the channel name to which we need to subscribe, 0 is the default DB
listener.subscribe('__keyevent@0__:expired');
listener.on('message', (chan, msg) => {
listener.get(`${msg}-details`, redis.print);
});
Getting the error below after running listener.get:
ReplyError: ERR only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT allowed in this context
I need the real key's value.