refactor(backend): rename cache class

This commit is contained in:
syuilo 2023-03-24 16:43:42 +09:00
parent 4a17906530
commit e438091113
15 changed files with 137 additions and 52 deletions

View file

@ -8,7 +8,7 @@ import type { Packed } from '@/misc/json-schema.js';
import type { Promiseable } from '@/misc/prelude/await-all.js';
import { awaitAll } from '@/misc/prelude/await-all.js';
import { USER_ACTIVE_THRESHOLD, USER_ONLINE_THRESHOLD } from '@/const.js';
import { Cache } from '@/misc/cache.js';
import { KVCache } from '@/misc/cache.js';
import type { Instance } from '@/models/entities/Instance.js';
import type { LocalUser, RemoteUser, User } from '@/models/entities/User.js';
import { birthdaySchema, descriptionSchema, localUsernameSchema, locationSchema, nameSchema, passwordSchema } from '@/models/entities/User.js';
@ -52,7 +52,7 @@ export class UserEntityService implements OnModuleInit {
private customEmojiService: CustomEmojiService;
private antennaService: AntennaService;
private roleService: RoleService;
private userInstanceCache: Cache<Instance | null>;
private userInstanceCache: KVCache<Instance | null>;
constructor(
private moduleRef: ModuleRef,
@ -121,7 +121,7 @@ export class UserEntityService implements OnModuleInit {
//private antennaService: AntennaService,
//private roleService: RoleService,
) {
this.userInstanceCache = new Cache<Instance | null>(1000 * 60 * 60 * 3);
this.userInstanceCache = new KVCache<Instance | null>(1000 * 60 * 60 * 3);
}
onModuleInit() {