sharkey/packages/backend/src/queue/const.ts
tamaina 0a06eb27da
enhance(backend): 設定ファイルでioredisの全てのオプションを指定可能に (#11329)
* enhance(backend): 設定ファイルでioredisの全てのオプションを指定可能に

* yappa kousuru

* fix

* fix?

* fix

* Revert "fix"

This reverts commit 227f19ff3afcbbd560b831493975206263a1a5a3.

* fix
2023-07-20 19:50:31 +09:00

24 lines
652 B
TypeScript

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: {
...config.redisForJobQueue,
keyPrefix: undefined
},
prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue:${queueName}` : `queue:${queueName}`,
};
}