fix: Don't retry asset caching in CI or developer_mode
This commit is contained in:
parent
04d6fbb628
commit
ef234da171
1 changed files with 9 additions and 4 deletions
|
|
@ -112,16 +112,21 @@ function log(...args) {
|
||||||
|
|
||||||
function get_redis_subscriber(kind) {
|
function get_redis_subscriber(kind) {
|
||||||
// get redis subscriber that aborts after 10 connection attempts
|
// get redis subscriber that aborts after 10 connection attempts
|
||||||
let { get_redis_subscriber: get_redis } = require("../node_utils");
|
let retry_strategy;
|
||||||
return get_redis(kind, {
|
let { get_redis_subscriber: get_redis, get_conf } = require("../node_utils");
|
||||||
retry_strategy: function(options) {
|
|
||||||
|
if (process.env.CI == 1 || get_conf().developer_mode == 1) {
|
||||||
|
retry_strategy = () => { }
|
||||||
|
} else {
|
||||||
|
retry_strategy = function (options) {
|
||||||
// abort after 10 connection attempts
|
// abort after 10 connection attempts
|
||||||
if (options.attempt > 10) {
|
if (options.attempt > 10) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return Math.min(options.attempt * 100, 2000);
|
return Math.min(options.attempt * 100, 2000);
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
return get_redis(kind, { retry_strategy });
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue