mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Count invalidation only on successful delete
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user