From ec5fa9ffcf4827ce5580299bc1ff61d870ae5386 Mon Sep 17 00:00:00 2001 From: Henry Date: Wed, 30 Jan 2019 21:06:07 +0000 Subject: [PATCH] Fix node-redis warning node_redis: Deprecated: The SETEX command contains a argument of type Promise. This is converted to "[object Promise]" by using .toString() now and will return an error from v.3.0 on. Please handle this in your code to make sure everything works as you intended it to. --- lib/middleware/redis-cache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/middleware/redis-cache.js b/lib/middleware/redis-cache.js index 764a82fdc..6ecbeaca4 100644 --- a/lib/middleware/redis-cache.js +++ b/lib/middleware/redis-cache.js @@ -46,7 +46,7 @@ module.exports = function(options = {}) { if (key) { const value = await redisClient.get(key); if (value) { - let ttl = redisClient.ttl(key); + let ttl = await redisClient.ttl(key); ttl = ttl > expire ? ttl : expire * 2; await redisClient.setex(key, ttl, value); }