From 7f3afac0a21b0a1465cb6c4ac19be608dcdbfe1d Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 4 Apr 2023 15:56:47 +0900 Subject: refactor(backend): rename Cache -> MemoryCache --- packages/backend/src/core/UserCacheService.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'packages/backend/src/core/UserCacheService.ts') diff --git a/packages/backend/src/core/UserCacheService.ts b/packages/backend/src/core/UserCacheService.ts index 631eb44062..e452caf5d1 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 { KVCache } from '@/misc/cache.js'; +import { MemoryKVCache } 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: KVCache; - public localUserByNativeTokenCache: KVCache; - public localUserByIdCache: KVCache; - public uriPersonCache: KVCache; + public userByIdCache: MemoryKVCache; + public localUserByNativeTokenCache: MemoryKVCache; + public localUserByIdCache: MemoryKVCache; + public uriPersonCache: MemoryKVCache; constructor( @Inject(DI.redisSubscriber) @@ -27,10 +27,10 @@ export class UserCacheService implements OnApplicationShutdown { ) { //this.onMessage = this.onMessage.bind(this); - this.userByIdCache = new KVCache(Infinity); - this.localUserByNativeTokenCache = new KVCache(Infinity); - this.localUserByIdCache = new KVCache(Infinity); - this.uriPersonCache = new KVCache(Infinity); + this.userByIdCache = new MemoryKVCache(Infinity); + this.localUserByNativeTokenCache = new MemoryKVCache(Infinity); + this.localUserByIdCache = new MemoryKVCache(Infinity); + this.uriPersonCache = new MemoryKVCache(Infinity); this.redisSubscriber.on('message', this.onMessage); } -- cgit v1.2.3-freya