diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-24 16:43:42 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-24 16:43:42 +0900 |
| commit | e4380911135b1aff7c85770d6dabb3e72e9874e7 (patch) | |
| tree | 30e1f4ec68d407708e55e612456676c33c048a97 /packages/backend/src/core/RoleService.ts | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | misskey-e4380911135b1aff7c85770d6dabb3e72e9874e7.tar.gz misskey-e4380911135b1aff7c85770d6dabb3e72e9874e7.tar.bz2 misskey-e4380911135b1aff7c85770d6dabb3e72e9874e7.zip | |
refactor(backend): rename cache class
Diffstat (limited to 'packages/backend/src/core/RoleService.ts')
| -rw-r--r-- | packages/backend/src/core/RoleService.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/core/RoleService.ts b/packages/backend/src/core/RoleService.ts index bb7680f4e5..7b63e43cb1 100644 --- a/packages/backend/src/core/RoleService.ts +++ b/packages/backend/src/core/RoleService.ts @@ -2,7 +2,7 @@ import { Inject, Injectable } from '@nestjs/common'; import Redis from 'ioredis'; import { In } from 'typeorm'; import type { Role, RoleAssignment, RoleAssignmentsRepository, RolesRepository, UsersRepository } from '@/models/index.js'; -import { Cache } from '@/misc/cache.js'; +import { KVCache } from '@/misc/cache.js'; import type { User } from '@/models/entities/User.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; @@ -57,8 +57,8 @@ export const DEFAULT_POLICIES: RolePolicies = { @Injectable() export class RoleService implements OnApplicationShutdown { - private rolesCache: Cache<Role[]>; - private roleAssignmentByUserIdCache: Cache<RoleAssignment[]>; + private rolesCache: KVCache<Role[]>; + private roleAssignmentByUserIdCache: KVCache<RoleAssignment[]>; public static AlreadyAssignedError = class extends Error {}; public static NotAssignedError = class extends Error {}; @@ -84,8 +84,8 @@ export class RoleService implements OnApplicationShutdown { ) { //this.onMessage = this.onMessage.bind(this); - this.rolesCache = new Cache<Role[]>(Infinity); - this.roleAssignmentByUserIdCache = new Cache<RoleAssignment[]>(Infinity); + this.rolesCache = new KVCache<Role[]>(Infinity); + this.roleAssignmentByUserIdCache = new KVCache<RoleAssignment[]>(Infinity); this.redisSubscriber.on('message', this.onMessage); } |