diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-08 21:27:21 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-08 21:27:21 +0900 |
| commit | a096f621cf5a47c3330935c2b9b5bfe54dfc0091 (patch) | |
| tree | b3b6a1a1ce5105091bebc80b96cfd5a73402da80 /packages/backend/src/queue/processors/DeliverProcessorService.ts | |
| parent | Merge pull request #10402 from misskey-dev/develop (diff) | |
| parent | [ci skip] Update CHANGELOG.md (diff) | |
| download | misskey-a096f621cf5a47c3330935c2b9b5bfe54dfc0091.tar.gz misskey-a096f621cf5a47c3330935c2b9b5bfe54dfc0091.tar.bz2 misskey-a096f621cf5a47c3330935c2b9b5bfe54dfc0091.zip | |
Merge pull request #10506 from misskey-dev/develop
13.11.0
Diffstat (limited to 'packages/backend/src/queue/processors/DeliverProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/processors/DeliverProcessorService.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/backend/src/queue/processors/DeliverProcessorService.ts b/packages/backend/src/queue/processors/DeliverProcessorService.ts index f637bf8818..0e99b7bcd2 100644 --- a/packages/backend/src/queue/processors/DeliverProcessorService.ts +++ b/packages/backend/src/queue/processors/DeliverProcessorService.ts @@ -7,7 +7,7 @@ import { MetaService } from '@/core/MetaService.js'; import { ApRequestService } from '@/core/activitypub/ApRequestService.js'; import { FederatedInstanceService } from '@/core/FederatedInstanceService.js'; import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js'; -import { KVCache } from '@/misc/cache.js'; +import { MemorySingleCache } from '@/misc/cache.js'; import type { Instance } from '@/models/entities/Instance.js'; import InstanceChart from '@/core/chart/charts/instance.js'; import ApRequestChart from '@/core/chart/charts/ap-request.js'; @@ -22,7 +22,7 @@ import type { DeliverJobData } from '../types.js'; @Injectable() export class DeliverProcessorService { private logger: Logger; - private suspendedHostsCache: KVCache<Instance[]>; + private suspendedHostsCache: MemorySingleCache<Instance[]>; private latest: string | null; constructor( @@ -46,7 +46,7 @@ export class DeliverProcessorService { private queueLoggerService: QueueLoggerService, ) { this.logger = this.queueLoggerService.logger.createSubLogger('deliver'); - this.suspendedHostsCache = new KVCache<Instance[]>(1000 * 60 * 60); + this.suspendedHostsCache = new MemorySingleCache<Instance[]>(1000 * 60 * 60); } @bindThis @@ -60,14 +60,14 @@ export class DeliverProcessorService { } // isSuspendedなら中断 - let suspendedHosts = this.suspendedHostsCache.get(null); + let suspendedHosts = this.suspendedHostsCache.get(); if (suspendedHosts == null) { suspendedHosts = await this.instancesRepository.find({ where: { isSuspended: true, }, }); - this.suspendedHostsCache.set(null, suspendedHosts); + this.suspendedHostsCache.set(suspendedHosts); } if (suspendedHosts.map(x => x.host).includes(this.utilityService.toPuny(host))) { return 'skip (suspended)'; |