0

Team,

i am trying to set config of redis at runtime using NODE js application as below.

let setConfig = await this.cacheConnection.config("set", "notify-keyspace-events", "Ex"); let setConfig = await this.cacheConnection.config("SET", "notify-keyspace-events", "Ex");

Above code is always returning false to me.

I am using redis node module in my application.All other commands like getAsync,SetAsync are working perfectly fine for me. let result = await this.cacheConnection.getAsync("keyname");

Any suggestion here would be great.

2 Answers2

0

please set Config after redis client ready to serve commands

const redisClient = this.cacheConnection;
redisClient.on("ready", function(err) {
    if(!err) redisClient.config("SET", "notify-keyspace-events", "Ex");
});
Amit Kumawat
  • 139
  • 2
  • 8
  • 1
    Thanks for the response. i got it working by below code. this.cacheConnection.configAsync("SET", "notify-keyspace-events", "KExe$"); – prabhat ranjan Oct 01 '19 at 06:09
0

this.cacheConnection.configAsync("SET", "notify-keyspace-events", "KExe$");