diff options
| author | Hazel K <acomputerdog@gmail.com> | 2024-08-03 14:49:06 -0400 |
|---|---|---|
| committer | Hazel K <acomputerdog@gmail.com> | 2024-08-03 14:49:06 -0400 |
| commit | 672f1ea68476f5d325c2c996eb3020fd69e99aad (patch) | |
| tree | 9bd31faf68aa1219f3f6b4cf19e37a7c9d1f0582 /packages/backend/src/core/RoleService.ts | |
| parent | implement pull-through caching (diff) | |
| download | sharkey-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.ts | 6 |
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); } |