From 48ccf7a73a4374373b2595241851f8d07848c0ed Mon Sep 17 00:00:00 2001 From: Daniel Hougaard Date: Sun, 13 Apr 2025 21:33:18 +0400 Subject: [PATCH] requested changes --- src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index b0ab59d..0aa40a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,9 +46,10 @@ const setupAxiosRetry = () => { config._retryCount!++; const exponentialDelay = Math.min(initialRetryDelay * Math.pow(backoffFactor, config._retryCount! - 1)); - return new Promise(async resolve => { - await new Promise(resolve => setTimeout(resolve, exponentialDelay)); - resolve(axiosInstance(config)); + return new Promise(resolve => { + setTimeout(() => { + resolve(axiosInstance(config)); + }, exponentialDelay); }); }