瀏覽代碼

fix(DX): reduce retry count for esbuild-redis

closes https://github.com/frappe/frappe/issues/17976
version-14
Ankush Menat 2 年之前
父節點
當前提交
727adb1054
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. +4
    -4
      esbuild/utils.js

+ 4
- 4
esbuild/utils.js 查看文件

@@ -111,15 +111,15 @@ function get_redis_subscriber(kind) {
let retry_strategy; let retry_strategy;
let { get_redis_subscriber: get_redis, get_conf } = require("../node_utils"); 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 = () => {}; retry_strategy = () => {};
} else { } else {
retry_strategy = function (options) { 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 undefined;
} }
return Math.min(options.attempt * 100, 2000);
return options.attempt * 100;
}; };
} }
return get_redis(kind, { retry_strategy }); return get_redis(kind, { retry_strategy });


Loading…
取消
儲存