refactor(backend): rename cache class
This commit is contained in:
		| @@ -4,7 +4,7 @@ import type { NotesRepository, UsersRepository } from '@/models/index.js'; | ||||
| import type { Config } from '@/config.js'; | ||||
| import { MetaService } from '@/core/MetaService.js'; | ||||
| import { MAX_NOTE_TEXT_LENGTH } from '@/const.js'; | ||||
| import { Cache } from '@/misc/cache.js'; | ||||
| import { KVCache } from '@/misc/cache.js'; | ||||
| import { UserEntityService } from '@/core/entities/UserEntityService.js'; | ||||
| import { bindThis } from '@/decorators.js'; | ||||
| import NotesChart from '@/core/chart/charts/notes.js'; | ||||
| @@ -118,7 +118,7 @@ export class NodeinfoServerService { | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		const cache = new Cache<Awaited<ReturnType<typeof nodeinfo2>>>(1000 * 60 * 10); | ||||
| 		const cache = new KVCache<Awaited<ReturnType<typeof nodeinfo2>>>(1000 * 60 * 10); | ||||
|  | ||||
| 		fastify.get(nodeinfo2_1path, async (request, reply) => { | ||||
| 			const base = await cache.fetch(null, () => nodeinfo2()); | ||||
|   | ||||
| @@ -3,7 +3,7 @@ import { DI } from '@/di-symbols.js'; | ||||
| import type { AccessTokensRepository, AppsRepository, UsersRepository } from '@/models/index.js'; | ||||
| import type { LocalUser } from '@/models/entities/User.js'; | ||||
| import type { AccessToken } from '@/models/entities/AccessToken.js'; | ||||
| import { Cache } from '@/misc/cache.js'; | ||||
| import { KVCache } from '@/misc/cache.js'; | ||||
| import type { App } from '@/models/entities/App.js'; | ||||
| import { UserCacheService } from '@/core/UserCacheService.js'; | ||||
| import isNativeToken from '@/misc/is-native-token.js'; | ||||
| @@ -18,7 +18,7 @@ export class AuthenticationError extends Error { | ||||
|  | ||||
| @Injectable() | ||||
| export class AuthenticateService { | ||||
| 	private appCache: Cache<App>; | ||||
| 	private appCache: KVCache<App>; | ||||
|  | ||||
| 	constructor( | ||||
| 		@Inject(DI.usersRepository) | ||||
| @@ -32,7 +32,7 @@ export class AuthenticateService { | ||||
|  | ||||
| 		private userCacheService: UserCacheService, | ||||
| 	) { | ||||
| 		this.appCache = new Cache<App>(Infinity); | ||||
| 		this.appCache = new KVCache<App>(Infinity); | ||||
| 	} | ||||
|  | ||||
| 	@bindThis | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo