Count invalidation only on successful delete

This commit is contained in:
Ajay 2024-02-08 15:12:48 -05:00
parent e61f964d17
commit c478546128

View file

@ -306,9 +306,9 @@ async function setupCacheClientListener(cacheClient: RedisClientType,
cacheConnectionClientId = String(await cacheClient.clientId());
cacheClient.subscribe("__redis__:invalidate", (messages) => {
cache.delete(messages?.[0]);
lastInvalidation = Date.now();
if (cache.delete(messages?.[0])) {
lastInvalidation = Date.now();
}
}).catch(Logger.error);
}