fix(cache): store cache TTL (#17044)

This commit is contained in:
Tony
2024-10-09 00:37:02 +08:00
committed by GitHub
parent 3a64e9eb91
commit 2a1af7dc90
+2 -2
View File
@@ -64,8 +64,8 @@ export default {
}
if (key) {
if (maxAge !== config.cache.contentExpire) {
// Only set cacheTtlKey if maxAge !== contentExpire
clients.redisClient.set(getCacheTtlKey(key), value, 'EX', maxAge);
// intentionally store the cache ttl if it is not the default value
clients.redisClient.set(getCacheTtlKey(key), maxAge, 'EX', maxAge);
}
return clients.redisClient.set(key, value, 'EX', maxAge); // setMode: https://redis.io/commands/set
}