diff --git a/packages/backend/src/global/CacheManagementService.ts b/packages/backend/src/global/CacheManagementService.ts index 30e74211fd..f350d765b7 100644 --- a/packages/backend/src/global/CacheManagementService.ts +++ b/packages/backend/src/global/CacheManagementService.ts @@ -24,7 +24,7 @@ import { bindThis } from '@/decorators.js'; import { DI } from '@/di-symbols.js'; import { TimeService, type TimerHandle } from '@/global/TimeService.js'; import { InternalEventService } from '@/global/InternalEventService.js'; -import { callAllOn } from '@/misc/call-all.js'; +import { callAllOn, callAllOnAsync } from '@/misc/call-all.js'; import type * as Redis from 'ioredis'; // This is the one place that's *supposed* to new() up caches. @@ -37,7 +37,7 @@ export type ManagedRedisSingleCache = Managed>; export type ManagedQuantumKVCache = Managed>; export type Managed = Omit; -export type Manager = { dispose(): void, clear(): void, gc(): void }; +export type Manager = { dispose(): Promise | void, clear(): void, gc(): void }; type CacheServices = MemoryCacheServices & RedisCacheServices & QuantumCacheServices; @@ -129,7 +129,7 @@ export class CacheManagementService implements OnApplicationShutdown { const toDispose = Array.from(this.managedCaches.values()); this.managedCaches.clear(); - callAllOn(toDispose, 'dispose'); + await callAllOnAsync(toDispose, 'dispose'); } @bindThis