summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/RoleService.ts
diff options
context:
space:
mode:
authorHazel K <acomputerdog@gmail.com>2024-08-03 14:49:06 -0400
committerHazel K <acomputerdog@gmail.com>2024-08-03 14:49:06 -0400
commit672f1ea68476f5d325c2c996eb3020fd69e99aad (patch)
tree9bd31faf68aa1219f3f6b4cf19e37a7c9d1f0582 /packages/backend/src/core/RoleService.ts
parentimplement pull-through caching (diff)
downloadsharkey-672f1ea68476f5d325c2c996eb3020fd69e99aad.tar.gz
sharkey-672f1ea68476f5d325c2c996eb3020fd69e99aad.tar.bz2
sharkey-672f1ea68476f5d325c2c996eb3020fd69e99aad.zip
tune cache lifetimes
Diffstat (limited to 'packages/backend/src/core/RoleService.ts')
-rw-r--r--packages/backend/src/core/RoleService.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts
index f5a753afc7..f46aacaef4 100644
--- a/packages/backend/src/core/RoleService.ts
+++ b/packages/backend/src/core/RoleService.ts
@@ -129,10 +129,8 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
private moderationLogService: ModerationLogService,
private fanoutTimelineService: FanoutTimelineService,
) {
- //this.onMessage = this.onMessage.bind(this);
-
- this.rolesCache = new MemorySingleCache<MiRole[]>(1000 * 60 * 60 * 1);
- this.roleAssignmentByUserIdCache = new MemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 60 * 1);
+ this.rolesCache = new MemorySingleCache<MiRole[]>(1000 * 60 * 60); // 1h
+ this.roleAssignmentByUserIdCache = new MemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 5); // 1h
this.redisForSub.on('message', this.onMessage);
}