feat: let the summary not expire

This commit is contained in:
DIYgod 2023-03-23 18:33:05 +00:00
parent b41fe03409
commit c7fb4966bd
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -53,7 +53,11 @@ export async function cacheGet(options: {
return JSON.parse(cacheValue)
} else {
const value = await options.getValueFun()
redis.set(redisKey, JSON.stringify(value), "EX", REDIS_EXPIRE)
if (options.noUpdate) {
redis.set(redisKey, JSON.stringify(value))
} else {
redis.set(redisKey, JSON.stringify(value), "EX", REDIS_EXPIRE)
}
return value
}
} else {