From 227f19ff3afcbbd560b831493975206263a1a5a3 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 20 Jul 2023 10:26:02 +0000 Subject: [PATCH] fix --- packages/backend/src/config.ts | 10 ++++++---- packages/backend/src/queue/const.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/config.ts b/packages/backend/src/config.ts index 2add8f7ac9..30c21ba68c 100644 --- a/packages/backend/src/config.ts +++ b/packages/backend/src/config.ts @@ -108,9 +108,9 @@ export type Mixin = { mediaProxy: string; externalMediaProxyEnabled: boolean; videoThumbnailGenerator: string | null; - redis: RedisOptions & RedisOptionsSource; - redisForPubsub: RedisOptions & RedisOptionsSource; - redisForJobQueue: RedisOptions & RedisOptionsSource; + redis: RedisOptions; + redisForPubsub: RedisOptions; + redisForJobQueue: RedisOptions; }; export type Config = Source & Mixin; @@ -188,10 +188,12 @@ function tryCreateUrl(url: string) { } function convertRedisOptions(options: RedisOptionsSource, host: string): RedisOptions { - return { + const result = { ...options, family: options.family == null ? 0 : options.family, keyPrefix: `${options.prefix ?? host}:`, db: options.db ?? 0, }; + delete result.prefix; + return result; } diff --git a/packages/backend/src/queue/const.ts b/packages/backend/src/queue/const.ts index d49951a1c3..4cf0aa6058 100644 --- a/packages/backend/src/queue/const.ts +++ b/packages/backend/src/queue/const.ts @@ -18,6 +18,6 @@ export function baseQueueOptions(config: Config, queueName: typeof QUEUE[keyof t ...config.redisForJobQueue, keyPrefix: undefined }, - prefix: config.redisForJobQueue.prefix ? `${config.redisForJobQueue.prefix}:queue:${queueName}` : `queue:${queueName}`, + prefix: config.redisForJobQueue.keyPrefix ? `${config.redisForJobQueue.keyPrefix}queue:${queueName}` : `queue:${queueName}`, }; }