From 132bdb272ab38ac1dfd9b26deaeac65b59d5e789 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 27 Oct 2024 03:49:42 +0800 Subject: [PATCH] Chore: reduce fetch-retry timeout --- Build/lib/fetch-retry.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Build/lib/fetch-retry.ts b/Build/lib/fetch-retry.ts index c37f8e1e..682e317e 100644 --- a/Build/lib/fetch-retry.ts +++ b/Build/lib/fetch-retry.ts @@ -29,7 +29,9 @@ const agent = new Agent({ setGlobalDispatcher(agent.compose( interceptors.retry({ maxRetries: 5, - minTimeout: 10000, + minTimeout: 500, // The initial retry delay in milliseconds + maxTimeout: 10 * 1000, // The maximum retry delay in milliseconds + // TODO: this part of code is only for allow more errors to be retried by default // This should be removed once https://github.com/nodejs/undici/issues/3728 is implemented // @ts-expect-error -- retry return type should be void @@ -58,7 +60,7 @@ setGlobalDispatcher(agent.compose( const { maxRetries = 5, minTimeout = 500, - maxTimeout = 30 * 1000, + maxTimeout = 10 * 1000, timeoutFactor = 2, methods = ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'] } = retryOptions;