diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-04 15:56:47 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-04 15:56:47 +0900 |
| commit | 7f3afac0a21b0a1465cb6c4ac19be608dcdbfe1d (patch) | |
| tree | cd8225f9e5546a0dea34d2d751e680c692ad5d4d /packages/backend/src/core/RoleService.ts | |
| parent | Merge pull request #10466 from misskey-dev/storybook (diff) | |
| download | misskey-7f3afac0a21b0a1465cb6c4ac19be608dcdbfe1d.tar.gz misskey-7f3afac0a21b0a1465cb6c4ac19be608dcdbfe1d.tar.bz2 misskey-7f3afac0a21b0a1465cb6c4ac19be608dcdbfe1d.zip | |
refactor(backend): rename Cache -> MemoryCache
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 7b63e43cb1..678bcfc337 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 { KVCache } from '@/misc/cache.js'; +import { MemoryKVCache } 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: KVCache<Role[]>; - private roleAssignmentByUserIdCache: KVCache<RoleAssignment[]>; + private rolesCache: MemoryKVCache<Role[]>; + private roleAssignmentByUserIdCache: MemoryKVCache<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 KVCache<Role[]>(Infinity); - this.roleAssignmentByUserIdCache = new KVCache<RoleAssignment[]>(Infinity); + this.rolesCache = new MemoryKVCache<Role[]>(Infinity); + this.roleAssignmentByUserIdCache = new MemoryKVCache<RoleAssignment[]>(Infinity); this.redisSubscriber.on('message', this.onMessage); } |