summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UserKeypairService.ts
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-08-06 16:51:18 +0000
committerdakkar <dakkar@thenautilus.net>2024-08-06 16:51:18 +0000
commit4e7df7a5f21f91d49318840600fe329cae05c919 (patch)
tree701cdaa4a1ae06412d86fc98529aa45ae26ae190 /packages/backend/src/core/UserKeypairService.ts
parentmerge: Add icon for moving files/folders - for !583 (!586) (diff)
parentFix timeout comments (diff)
downloadsharkey-4e7df7a5f21f91d49318840600fe329cae05c919.tar.gz
sharkey-4e7df7a5f21f91d49318840600fe329cae05c919.tar.bz2
sharkey-4e7df7a5f21f91d49318840600fe329cae05c919.zip
merge: Remove infinite caches to prevent memory leak (!587)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/587 Closes #600 and #601 Approved-by: Amelia Yukii <amelia.yukii@shourai.de> Approved-by: Marie <marie@kaifa.ch>
Diffstat (limited to 'packages/backend/src/core/UserKeypairService.ts')
-rw-r--r--packages/backend/src/core/UserKeypairService.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/backend/src/core/UserKeypairService.ts b/packages/backend/src/core/UserKeypairService.ts
index 51ac99179a..92d61cd103 100644
--- a/packages/backend/src/core/UserKeypairService.ts
+++ b/packages/backend/src/core/UserKeypairService.ts
@@ -25,7 +25,7 @@ export class UserKeypairService implements OnApplicationShutdown {
) {
this.cache = new RedisKVCache<MiUserKeypair>(this.redisClient, 'userKeypair', {
lifetime: 1000 * 60 * 60 * 24, // 24h
- memoryCacheLifetime: Infinity,
+ memoryCacheLifetime: 1000 * 60 * 60, // 1h
fetcher: (key) => this.userKeypairsRepository.findOneByOrFail({ userId: key }),
toRedisConverter: (value) => JSON.stringify(value),
fromRedisConverter: (value) => JSON.parse(value),