diff --git a/esbuild/utils.js b/esbuild/utils.js index 301797d35e..82490adb36 100644 --- a/esbuild/utils.js +++ b/esbuild/utils.js @@ -111,12 +111,12 @@ function log(...args) { } function get_redis_subscriber(kind) { - // get redis subscriber that aborts after 50 connection attempts + // get redis subscriber that aborts after 10 connection attempts let { get_redis_subscriber: get_redis } = require("../node_utils"); return get_redis(kind, { retry_strategy: function(options) { - // abort after 50 connection attempts - if (options.attempt > 50) { + // abort after 10 connection attempts + if (options.attempt > 10) { return undefined; } return Math.min(options.attempt * 100, 2000); diff --git a/node_utils.js b/node_utils.js index c38caa2b3d..b87c99a07c 100644 --- a/node_utils.js +++ b/node_utils.js @@ -38,17 +38,10 @@ function get_conf() { return conf; } -function get_redis_subscriber(kind="redis_socketio", options=null) { +function get_redis_subscriber(kind="redis_socketio", options={}) { const conf = get_conf(); const host = conf[kind] || conf.redis_async_broker_port; - - if (options) { - return redis.createClient({ - host, - ...options - }); - } - return redis.createClient(host); + return redis.createClient({ url: host, ...options }); } module.exports = {