mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Trigger usage of cache key when checking ttl
This commit is contained in:
parent
0602fdd651
commit
47bea9ee6e
1 changed files with 3 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue