From f25de65c75a64344e1235a8f3da707f7734ccb6c Mon Sep 17 00:00:00 2001 From: Wiktor Plaga Date: Thu, 29 Jan 2026 11:31:23 +0100 Subject: [PATCH] Add requests timeout and retry on timeout --- lib/chartmogul/util/retry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/chartmogul/util/retry.js b/lib/chartmogul/util/retry.js index 190ac9e..e8075d3 100644 --- a/lib/chartmogul/util/retry.js +++ b/lib/chartmogul/util/retry.js @@ -22,7 +22,8 @@ const RETRIABLE_ERRORS = [ 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', - 'EAI_AGAIN' + 'EAI_AGAIN', + 'ECONNABORTED' ]; function retryOnNetworkError (err) { @@ -49,6 +50,7 @@ module.exports = function retryRequest (retries, options, cb) { const request = superagent(options.method || 'get', requestUrl) .auth(options.auth.user, options.auth.pass) .set(options.headers) + .timeout({ response: 30000, deadline: 120000 }) .query(options.qs) .send(options.body);