+ static getRedisClientOptions (name?: string, options: RedisOptions = {}): RedisOptions {
+ const connectionName = [ 'PeerTube', name ].join('')
+ const connectTimeout = 20000 // Could be slow since node use sync call to compile PeerTube
+
+ if (CONFIG.REDIS.SENTINEL.ENABLED) {
+ return {
+ connectionName,
+ connectTimeout,
+ enableTLSForSentinelMode: CONFIG.REDIS.SENTINEL.ENABLE_TLS,
+ sentinelPassword: CONFIG.REDIS.AUTH,
+ sentinels: CONFIG.REDIS.SENTINEL.SENTINELS,
+ name: CONFIG.REDIS.SENTINEL.MASTER_NAME,
+ ...options
+ }
+ }
+