Redis Config Set with Node jS



Team,

我正在尝试使用 NODE JS 应用程序在运行时设置 Redis 的配置,如下所示。

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

上面的代码总是向我返回 false。

我正在我的应用程序中使用 redis 节点模块。所有其他命令,如getAsync,SetAsync对我来说都很好用。 let result = await this.cacheConnection.getAsync("keyname"(;

这里的任何建议都会很棒。

请在 redis 客户端准备好提供命令后设置 Config

const redisClient = this.cacheConnection;
redisClient.on("ready", function(err) {
if(!err) redisClient.config("SET", "notify-keyspace-events", "Ex");
});

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

最新更新