diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-04-13 12:18:07 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-13 12:18:07 +0900 |
| commit | c5d2dba28d1e99f9c152840ca7f47e8f51c7423b (patch) | |
| tree | 8d4b388039b3f936e7dfb8914efa827bf026b110 /packages/backend/src/core/QueueModule.ts | |
| parent | Merge pull request #10606 from misskey-dev/EbiseLutica-patch-1 (diff) | |
| parent | [ci skip] improve readability (diff) | |
| download | misskey-c5d2dba28d1e99f9c152840ca7f47e8f51c7423b.tar.gz misskey-c5d2dba28d1e99f9c152840ca7f47e8f51c7423b.tar.bz2 misskey-c5d2dba28d1e99f9c152840ca7f47e8f51c7423b.zip | |
Merge pull request #10608 from misskey-dev/develop
Release: 13.11.3
Diffstat (limited to 'packages/backend/src/core/QueueModule.ts')
| -rw-r--r-- | packages/backend/src/core/QueueModule.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/backend/src/core/QueueModule.ts b/packages/backend/src/core/QueueModule.ts index 8733a7d7eb..bac85d7a15 100644 --- a/packages/backend/src/core/QueueModule.ts +++ b/packages/backend/src/core/QueueModule.ts @@ -3,7 +3,7 @@ import Bull from 'bull'; import { DI } from '@/di-symbols.js'; import type { Config } from '@/config.js'; import type { Provider } from '@nestjs/common'; -import type { DeliverJobData, InboxJobData, DbJobData, ObjectStorageJobData, EndedPollNotificationJobData, WebhookDeliverJobData } from '../queue/types.js'; +import type { DeliverJobData, InboxJobData, DbJobData, ObjectStorageJobData, EndedPollNotificationJobData, WebhookDeliverJobData, RelationshipJobData, DbJobMap } from '../queue/types.js'; function q<T>(config: Config, name: string, limitPerSec = -1) { return new Bull<T>(name, { @@ -41,7 +41,8 @@ export type SystemQueue = Bull.Queue<Record<string, unknown>>; export type EndedPollNotificationQueue = Bull.Queue<EndedPollNotificationJobData>; export type DeliverQueue = Bull.Queue<DeliverJobData>; export type InboxQueue = Bull.Queue<InboxJobData>; -export type DbQueue = Bull.Queue<DbJobData>; +export type DbQueue = Bull.Queue<DbJobData<keyof DbJobMap>>; +export type RelationshipQueue = Bull.Queue<RelationshipJobData>; export type ObjectStorageQueue = Bull.Queue<ObjectStorageJobData>; export type WebhookDeliverQueue = Bull.Queue<WebhookDeliverJobData>; @@ -75,6 +76,12 @@ const $db: Provider = { inject: [DI.config], }; +const $relationship: Provider = { + provide: 'queue:relationship', + useFactory: (config: Config) => q(config, 'relationship'), + inject: [DI.config], +}; + const $objectStorage: Provider = { provide: 'queue:objectStorage', useFactory: (config: Config) => q(config, 'objectStorage'), @@ -96,6 +103,7 @@ const $webhookDeliver: Provider = { $deliver, $inbox, $db, + $relationship, $objectStorage, $webhookDeliver, ], @@ -105,6 +113,7 @@ const $webhookDeliver: Provider = { $deliver, $inbox, $db, + $relationship, $objectStorage, $webhookDeliver, ], |