From 0a6433bf5d576b61ee35fcb6a5678aba65b2cab6 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sun, 4 Sep 2022 11:14:16 +0530 Subject: [PATCH] fix(DX): reduce retry count for esbuild-redis closes https://github.com/frappe/frappe/issues/17976 --- esbuild/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esbuild/utils.js b/esbuild/utils.js index db58b89e8b..3edccfd024 100644 --- a/esbuild/utils.js +++ b/esbuild/utils.js @@ -111,15 +111,15 @@ function get_redis_subscriber(kind) { let retry_strategy; let { get_redis_subscriber: get_redis, get_conf } = require("../node_utils"); - if (process.env.CI == 1 || get_conf().developer_mode == 1) { + if (process.env.CI == 1 || get_conf().developer_mode == 0) { retry_strategy = () => {}; } else { retry_strategy = function (options) { - // abort after 10 connection attempts - if (options.attempt > 10) { + // abort after 5 x 3 connection attempts ~= 3 seconds + if (options.attempt > 4) { return undefined; } - return Math.min(options.attempt * 100, 2000); + return options.attempt * 100; }; } return get_redis(kind, { retry_strategy });