mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-12 01:00:34 +08:00
Chore: reduce fetch-retry timeout
This commit is contained in:
parent
a42d28195d
commit
132bdb272a
@ -29,7 +29,9 @@ const agent = new Agent({
|
|||||||
setGlobalDispatcher(agent.compose(
|
setGlobalDispatcher(agent.compose(
|
||||||
interceptors.retry({
|
interceptors.retry({
|
||||||
maxRetries: 5,
|
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
|
// 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
|
// This should be removed once https://github.com/nodejs/undici/issues/3728 is implemented
|
||||||
// @ts-expect-error -- retry return type should be void
|
// @ts-expect-error -- retry return type should be void
|
||||||
@ -58,7 +60,7 @@ setGlobalDispatcher(agent.compose(
|
|||||||
const {
|
const {
|
||||||
maxRetries = 5,
|
maxRetries = 5,
|
||||||
minTimeout = 500,
|
minTimeout = 500,
|
||||||
maxTimeout = 30 * 1000,
|
maxTimeout = 10 * 1000,
|
||||||
timeoutFactor = 2,
|
timeoutFactor = 2,
|
||||||
methods = ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE']
|
methods = ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE']
|
||||||
} = retryOptions;
|
} = retryOptions;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user