Trigger usage of cache key when checking ttl

This commit is contained in:
Ajay 2024-04-11 17:57:53 -04:00
parent 0602fdd651
commit 47bea9ee6e

View file

@ -196,6 +196,9 @@ if (config.redis?.enabled) {
const ttl = client.ttl.bind(client);
exportClient.ttl = (key) => {
if (cache && cacheClient && cache.has(key)) {
// Trigger usage of cache
cache.get(key);
return Promise.resolve(config.redis?.expiryTime - Math.floor((cache.ttl - cache.info(key).ttl) / 1000));
} else {
return ttl(createKeyName(key));