normalize cache constructors and detect duplicate cache names

This commit is contained in:
Hazelnoot 2025-11-02 11:58:28 -05:00
parent 151550602c
commit 8271dc199e
18 changed files with 95 additions and 61 deletions

View file

@ -162,8 +162,8 @@ export class RoleService implements OnApplicationShutdown, OnModuleInit {
cacheManagementService: CacheManagementService,
) {
this.rolesCache = cacheManagementService.createMemorySingleCache<MiRole[]>(1000 * 60 * 60); // 1h
this.roleAssignmentByUserIdCache = cacheManagementService.createMemoryKVCache<MiRoleAssignment[]>(1000 * 60 * 5); // 5m
this.rolesCache = cacheManagementService.createMemorySingleCache<MiRole[]>('roles', 1000 * 60 * 60); // 1h
this.roleAssignmentByUserIdCache = cacheManagementService.createMemoryKVCache<MiRoleAssignment[]>('roleAssignment', 1000 * 60 * 5); // 5m
// TODO additional cache for final calculation?
this.redisForSub.on('message', this.onMessage);