diff --git a/src/utils/redis.ts b/src/utils/redis.ts index d6da615..c555b7e 100644 --- a/src/utils/redis.ts +++ b/src/utils/redis.ts @@ -104,9 +104,10 @@ if (config.redis?.enabled) { const createKeyName = (key: RedisCommandArgument) => (key + (config.redis.useCompression ? ".c" : "")) as RedisCommandArgument; exportClient.getWithCache = (key) => { - if (cache && cacheClient && cache.has(key)) { + const cachedItem = cache && cacheClient && cache.get(key); + if (cachedItem != null) { memoryCacheHits++; - return Promise.resolve(cache.get(key)); + return Promise.resolve(cachedItem); } else if (shouldClientCacheKey(key)) { memoryCacheMisses++; }