c2370a1be6
* chore: Add the SPDX information to each file Add copyright and licensing information as defined in version 3.0 of the REUSE Specification. * tweak format --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
28 lines
768 B
TypeScript
28 lines
768 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
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}`,
|
|
};
|
|
}
|