From 6e1ae7b2426fc5729f410a52db1c0b8adcc69d36 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Apr 2023 18:15:47 +0900 Subject: [PATCH] enhance(backend): tweak cache of role #10439 --- packages/backend/src/core/RoleService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index 3379f5af8b..c8ebe1adb7 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -84,8 +84,8 @@ export class RoleService implements OnApplicationShutdown { ) { //this.onMessage = this.onMessage.bind(this); - this.rolesCache = new MemorySingleCache(Infinity); - this.roleAssignmentByUserIdCache = new MemoryKVCache(Infinity); + this.rolesCache = new MemorySingleCache(1000 * 60 * 60 * 1); + this.roleAssignmentByUserIdCache = new MemoryKVCache(1000 * 60 * 60 * 1); this.redisForPubsub.on('message', this.onMessage); }