summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/UserCacheService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-24 16:43:42 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2023-03-24 16:43:42 +0900
commite4380911135b1aff7c85770d6dabb3e72e9874e7 (patch)
tree30e1f4ec68d407708e55e612456676c33c048a97 /packages/backend/src/core/UserCacheService.ts
parentMerge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff)
downloadsharkey-e4380911135b1aff7c85770d6dabb3e72e9874e7.tar.gz
sharkey-e4380911135b1aff7c85770d6dabb3e72e9874e7.tar.bz2
sharkey-e4380911135b1aff7c85770d6dabb3e72e9874e7.zip
refactor(backend): rename cache class
Diffstat (limited to 'packages/backend/src/core/UserCacheService.ts')
-rw-r--r--packages/backend/src/core/UserCacheService.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/backend/src/core/UserCacheService.ts b/packages/backend/src/core/UserCacheService.ts
index fc383d1c08..631eb44062 100644
--- a/packages/backend/src/core/UserCacheService.ts
+++ b/packages/backend/src/core/UserCacheService.ts
@@ -1,7 +1,7 @@
import { Inject, Injectable } from '@nestjs/common';
import Redis from 'ioredis';
import type { UsersRepository } from '@/models/index.js';
-import { Cache } from '@/misc/cache.js';
+import { KVCache } from '@/misc/cache.js';
import type { LocalUser, User } from '@/models/entities/User.js';
import { DI } from '@/di-symbols.js';
import { UserEntityService } from '@/core/entities/UserEntityService.js';
@@ -11,10 +11,10 @@ import type { OnApplicationShutdown } from '@nestjs/common';
@Injectable()
export class UserCacheService implements OnApplicationShutdown {
- public userByIdCache: Cache<User>;
- public localUserByNativeTokenCache: Cache<LocalUser | null>;
- public localUserByIdCache: Cache<LocalUser>;
- public uriPersonCache: Cache<User | null>;
+ public userByIdCache: KVCache<User>;
+ public localUserByNativeTokenCache: KVCache<LocalUser | null>;
+ public localUserByIdCache: KVCache<LocalUser>;
+ public uriPersonCache: KVCache<User | null>;
constructor(
@Inject(DI.redisSubscriber)
@@ -27,10 +27,10 @@ export class UserCacheService implements OnApplicationShutdown {
) {
//this.onMessage = this.onMessage.bind(this);
- this.userByIdCache = new Cache<User>(Infinity);
- this.localUserByNativeTokenCache = new Cache<LocalUser | null>(Infinity);
- this.localUserByIdCache = new Cache<LocalUser>(Infinity);
- this.uriPersonCache = new Cache<User | null>(Infinity);
+ this.userByIdCache = new KVCache<User>(Infinity);
+ this.localUserByNativeTokenCache = new KVCache<LocalUser | null>(Infinity);
+ this.localUserByIdCache = new KVCache<LocalUser>(Infinity);
+ this.uriPersonCache = new KVCache<User | null>(Infinity);
this.redisSubscriber.on('message', this.onMessage);
}