0a06eb27da
* enhance(backend): 設定ファイルでioredisの全てのオプションを指定可能に * yappa kousuru * fix * fix? * fix * Revert "fix" This reverts commit 227f19ff3afcbbd560b831493975206263a1a5a3. * fix
24 lines
652 B
TypeScript
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}`,
|
|
};
|
|
}
|