diff --git a/packages/backend/src/misc/cache.ts b/packages/backend/src/misc/cache.ts index 742dad0857..d385a3e75e 100644 --- a/packages/backend/src/misc/cache.ts +++ b/packages/backend/src/misc/cache.ts @@ -55,7 +55,10 @@ export class RedisKVCache { const cached = await this.redisClient.get(`kvcache:${this.name}:${key}`); if (cached == null) return undefined; - return this.fromRedisConverter(cached); + const parsed = this.fromRedisConverter(cached); + if (parsed == null) return undefined; + this.memoryCache.set(key, parsed); + return parsed; } @bindThis @@ -150,7 +153,7 @@ export class RedisSingleCache { const cached = await this.redisClient.get(`singlecache:${this.name}`); if (cached == null) return undefined; const parsed = this.fromRedisConverter(cached); - if (parsed == null) return undefined; + if (parsed == null) return undefined; this.memoryCache.set(parsed); return parsed; }