summaryrefslogtreecommitdiff
path: root/packages/backend/src/queue/processors/DeliverProcessorService.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2023-03-25 08:36:41 +0900
committerGitHub <noreply@github.com>2023-03-25 08:36:41 +0900
commitf54a9542bb2458e5f83bc7bcf25803a1bb76cef8 (patch)
tree03a62e0b9508b75e55b71300b93a1bf540f84812 /packages/backend/src/queue/processors/DeliverProcessorService.ts
parentMerge pull request #10388 from misskey-dev/develop (diff)
parentNew Crowdin updates (#10405) (diff)
downloadmisskey-f54a9542bb2458e5f83bc7bcf25803a1bb76cef8.tar.gz
misskey-f54a9542bb2458e5f83bc7bcf25803a1bb76cef8.tar.bz2
misskey-f54a9542bb2458e5f83bc7bcf25803a1bb76cef8.zip
Merge pull request #10402 from misskey-dev/develop
Release: 13.10.3
Diffstat (limited to 'packages/backend/src/queue/processors/DeliverProcessorService.ts')
-rw-r--r--packages/backend/src/queue/processors/DeliverProcessorService.ts17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/backend/src/queue/processors/DeliverProcessorService.ts b/packages/backend/src/queue/processors/DeliverProcessorService.ts
index 43a92bb267..f637bf8818 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 { Cache } from '@/misc/cache.js';
+import { KVCache } 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: Cache<Instance[]>;
+ private suspendedHostsCache: KVCache<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 Cache<Instance[]>(1000 * 60 * 60);
+ this.suspendedHostsCache = new KVCache<Instance[]>(1000 * 60 * 60);
}
@bindThis
@@ -88,10 +88,12 @@ export class DeliverProcessorService {
}
this.fetchInstanceMetadataService.fetchInstanceMetadata(i);
-
- this.instanceChart.requestSent(i.host, true);
this.apRequestChart.deliverSucc();
this.federationChart.deliverd(i.host, true);
+
+ if (meta.enableChartsForFederatedInstances) {
+ this.instanceChart.requestSent(i.host, true);
+ }
});
return 'Success';
@@ -107,9 +109,12 @@ export class DeliverProcessorService {
});
}
- this.instanceChart.requestSent(i.host, false);
this.apRequestChart.deliverFail();
this.federationChart.deliverd(i.host, false);
+
+ if (meta.enableChartsForFederatedInstances) {
+ this.instanceChart.requestSent(i.host, false);
+ }
});
if (res instanceof StatusError) {