0
我正在使用connect-domain和connect-redis。下面的代码检查Redis数据库中的Redis缓存。Redis连接关闭
function redis_get(key, req, res) {
var redisClient = redis.createClient();
redisClient.get(redisKey, function (err, data) {
if (err) {
console.log("Error in RedisDB");
}
else if (data == null) {
// Calling external function
}
else {
// Calling external function
}
redisClient.quit(); // Not working
});
}
当缓存不是缴费林调用外部函数。一旦缓存检查完成,我想要关闭redis连接。 redisClient.quit()//不工作
对此的任何帮助将非常有帮助。
感谢
@ user87267867你能告诉我你的错误吗? – sachin