From 9fb16cf3449a99286d42a3119c15a1cb54c12fd4 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 16 Jun 2023 14:26:24 +0200 Subject: [PATCH] refs #4823 Minor changes --- .env_template | 1 + utils.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.env_template b/.env_template index 79ecb68..953844a 100644 --- a/.env_template +++ b/.env_template @@ -26,6 +26,7 @@ TIME_STAMPS = true #REQUEST CONFIG MS_RETRY_UNHANDLED_ERROR = 900000 +MS_RETRY_LOST_CONNECTION = 900000 #DEV OPTIONS ORGS_ALWAYS_CONN = false \ No newline at end of file diff --git a/utils.js b/utils.js index 8514ce9..a0fe090 100644 --- a/utils.js +++ b/utils.js @@ -741,9 +741,9 @@ export async function vnRequest(method, url, data, headers) { } catch (err) { switch (err.code) { case 'ECONNRESET': // Client network socket TLS - case 'EAI_AGAIN': // getaddrinfo - await await warnSpin(null, err, false); - await sleep(1000); + case 'EAI_AGAIN': // getaddrinfo || Lost connection + await warnSpin(null, err, false); + await sleep(env.MS_RETRY_LOST_CONNECTION); break; case 'ECONNABORTED': case 'ECONNREFUSED': @@ -778,7 +778,7 @@ export async function vnRequest(method, url, data, headers) { await sleep(env.MS_RETRY_UNHANDLED_ERROR); break; } - await startSpin(); + if (!err?.code === 'EAI_AGAIN') await startSpin(); } } };