mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-21 02:56:40 -08:00
fix(core): Add an option to enable dual-stack lookup to support IPv6 for redis (#13118)
This commit is contained in:
parent
8b28d6ce8e
commit
be39d0a0f1
|
@ -52,6 +52,10 @@ class RedisConfig {
|
||||||
/** Whether to enable TLS on Redis connections. */
|
/** Whether to enable TLS on Redis connections. */
|
||||||
@Env('QUEUE_BULL_REDIS_TLS')
|
@Env('QUEUE_BULL_REDIS_TLS')
|
||||||
tls: boolean = false;
|
tls: boolean = false;
|
||||||
|
|
||||||
|
/** Whether to enable dual-stack hostname resolution for Redis connections. */
|
||||||
|
@Env('QUEUE_BULL_REDIS_DUALSTACK')
|
||||||
|
dualStack: boolean = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Config
|
@Config
|
||||||
|
|
|
@ -214,6 +214,7 @@ describe('GlobalConfig', () => {
|
||||||
username: '',
|
username: '',
|
||||||
clusterNodes: '',
|
clusterNodes: '',
|
||||||
tls: false,
|
tls: false,
|
||||||
|
dualStack: false,
|
||||||
},
|
},
|
||||||
gracefulShutdownTimeout: 30,
|
gracefulShutdownTimeout: 30,
|
||||||
prefix: 'bull',
|
prefix: 'bull',
|
||||||
|
|
|
@ -131,7 +131,7 @@ export class RedisClientService extends TypedEmitter<RedisEventMap> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getOptions({ extraOptions }: { extraOptions?: RedisOptions }) {
|
private getOptions({ extraOptions }: { extraOptions?: RedisOptions }) {
|
||||||
const { username, password, db, tls } = this.globalConfig.queue.bull.redis;
|
const { username, password, db, tls, dualStack } = this.globalConfig.queue.bull.redis;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disabling ready check allows quick reconnection to Redis if Redis becomes
|
* Disabling ready check allows quick reconnection to Redis if Redis becomes
|
||||||
|
@ -153,6 +153,8 @@ export class RedisClientService extends TypedEmitter<RedisEventMap> {
|
||||||
...extraOptions,
|
...extraOptions,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (dualStack) options.family = 0;
|
||||||
|
|
||||||
if (tls) options.tls = {}; // enable TLS with default Node.js settings
|
if (tls) options.tls = {}; // enable TLS with default Node.js settings
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
|
|
Loading…
Reference in a new issue