diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-06-05 19:47:08 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-05 19:47:08 +0900 |
| commit | 407a965c1d78db9b13ec89a7be910b3c120aafcf (patch) | |
| tree | 33e00f7a00c4e33b2c95a6e2aba85cea7b9f05f6 /packages/backend/src/queue/const.ts | |
| parent | Merge pull request #10833 from misskey-dev/develop (diff) | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | misskey-407a965c1d78db9b13ec89a7be910b3c120aafcf.tar.gz misskey-407a965c1d78db9b13ec89a7be910b3c120aafcf.tar.bz2 misskey-407a965c1d78db9b13ec89a7be910b3c120aafcf.zip | |
Merge pull request #10932 from misskey-dev/develop
Release: 13.13.0
Diffstat (limited to 'packages/backend/src/queue/const.ts')
| -rw-r--r-- | packages/backend/src/queue/const.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/backend/src/queue/const.ts b/packages/backend/src/queue/const.ts new file mode 100644 index 0000000000..d240fe70e0 --- /dev/null +++ b/packages/backend/src/queue/const.ts @@ -0,0 +1,26 @@ +import { Config } from '@/config.js'; +import type * as Bull from 'bullmq'; + +export const QUEUE = { + DELIVER: 'deliver', + INBOX: 'inbox', + SYSTEM: 'system', + ENDED_POLL_NOTIFICATION: 'endedPollNotification', + DB: 'db', + RELATIONSHIP: 'relationship', + OBJECT_STORAGE: 'objectStorage', + WEBHOOK_DELIVER: 'webhookDeliver', +}; + +export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof typeof QUEUE]): Bull.QueueOptions { + return { + connection: { + port: config.redisForJobQueue.port, + host: config.redisForJobQueue.host, + family: config.redisForJobQueue.family == null ? 0 : config.redisForJobQueue.family, + password: config.redisForJobQueue.pass, + db: config.redisForJobQueue.db ?? 0, + }, + prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue:${queueName}` : `queue:${queueName}`, + }; +} |