mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 09:27:50 +00:00
feat: added support for redis cluster
This commit is contained in:
@@ -415,6 +415,7 @@ export const queueServiceFactory = (
|
||||
redisCfg: TRedisConfigKeys,
|
||||
{ dbConnectionUrl, dbRootCert }: { dbConnectionUrl: string; dbRootCert?: string }
|
||||
): TQueueServiceFactory => {
|
||||
const isClusterMode = Boolean(redisCfg?.REDIS_CLUSTER_HOSTS);
|
||||
const connection = buildRedisFromConfig(redisCfg);
|
||||
const queueContainer = {} as Record<
|
||||
QueueName,
|
||||
@@ -457,6 +458,8 @@ export const queueServiceFactory = (
|
||||
}
|
||||
|
||||
queueContainer[name] = new Queue(name as string, {
|
||||
// ref: docs.bullmq.io/bull/patterns/redis-cluster
|
||||
prefix: isClusterMode ? `{${name}}` : undefined,
|
||||
...queueSettings,
|
||||
...(crypto.isFipsModeEnabled()
|
||||
? {
|
||||
@@ -472,6 +475,7 @@ export const queueServiceFactory = (
|
||||
const appCfg = getConfig();
|
||||
if (appCfg.QUEUE_WORKERS_ENABLED && isQueueEnabled(name)) {
|
||||
workerContainer[name] = new Worker(name, jobFn, {
|
||||
prefix: isClusterMode ? `{${name}}` : undefined,
|
||||
...queueSettings,
|
||||
...(crypto.isFipsModeEnabled()
|
||||
? {
|
||||
|
||||
Reference in New Issue
Block a user