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

@ -2,7 +2,7 @@ import { Inject, Injectable } from '@nestjs/common';
import { IsNull } from 'typeorm';
import type { LocalUser } from '@/models/entities/User.js';
import type { UsersRepository } from '@/models/index.js';
import { Cache } from '@/misc/cache.js';
import { KVCache } from '@/misc/cache.js';
import { DI } from '@/di-symbols.js';
import { CreateSystemUserService } from '@/core/CreateSystemUserService.js';
import { bindThis } from '@/decorators.js';
@ -11,7 +11,7 @@ const ACTOR_USERNAME = 'instance.actor' as const;
@Injectable()
export class InstanceActorService {
private cache: Cache<LocalUser>;
private cache: KVCache<LocalUser>;
constructor(
@Inject(DI.usersRepository)
@ -19,7 +19,7 @@ export class InstanceActorService {
private createSystemUserService: CreateSystemUserService,
) {
this.cache = new Cache<LocalUser>(Infinity);
this.cache = new KVCache<LocalUser>(Infinity);
}
@bindThis