Revert "enhance(backend): redisForJobQueue の接続を使い回す (MisskeyIO#268)" (MisskeyIO#292)

This reverts commit 7122657f13.
This commit is contained in:
まっちゃとーにゅ 2023-12-28 05:33:22 +09:00 committed by GitHub
parent f207c962b5
commit bd265caf65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 55 deletions

View file

@ -5,7 +5,6 @@
import { Config } from '@/config.js';
import type * as Bull from 'bullmq';
import type * as Redis from 'ioredis';
export const QUEUE = {
DELIVER: 'deliver',
@ -18,9 +17,13 @@ export const QUEUE = {
WEBHOOK_DELIVER: 'webhookDeliver',
};
export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof typeof QUEUE], redisConnection: Redis.Redis): Bull.QueueOptions {
export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof typeof QUEUE]): Bull.QueueOptions {
return {
connection: redisConnection,
connection: {
...config.redisForJobQueue,
maxRetriesPerRequest: null,
keyPrefix: undefined,
},
prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue:${queueName}` : `queue:${queueName}`,
};
}