mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-27 22:39:33 +09:00
Hot-fix: Write-back value in memory when it's available in redis (MisskeyIO#174)
* Write-back value in memory when it's available in redis * Fix recursive cache * Fix bug in case that invalid data in redis cache
This commit is contained in:
parent
3717666807
commit
533bae1e6c
@ -149,7 +149,10 @@ export class RedisSingleCache<T> {
|
||||
|
||||
const cached = await this.redisClient.get(`singlecache:${this.name}`);
|
||||
if (cached == null) return undefined;
|
||||
return this.fromRedisConverter(cached);
|
||||
const parsed = this.fromRedisConverter(cached);
|
||||
if (parsed == null) return undefined;
|
||||
this.memoryCache.set(parsed);
|
||||
return parsed;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
Loading…
Reference in New Issue
Block a user