Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina committed Jul 20, 2023
1 parent dfd6b4f commit 227f19f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions packages/backend/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion packages/backend/src/queue/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
};
}

0 comments on commit 227f19f

Please sign in to comment.