Chore: minor changes

This commit is contained in:
SukkaW
2025-01-17 23:06:51 +08:00
parent 6f8d515e7c
commit 6235d9fee0
8 changed files with 20 additions and 36 deletions

View File

@@ -95,10 +95,9 @@ setGlobalDispatcher(agent.compose(
: retryAfter * 1e3; // Retry-After is in seconds
}
const retryTimeout
= retryAfter > 0
? Math.min(retryAfter, maxTimeout)
: Math.min(minTimeout * (timeoutFactor ** (counter - 1)), maxTimeout);
const retryTimeout = retryAfter > 0
? Math.min(retryAfter, maxTimeout)
: Math.min(minTimeout * (timeoutFactor ** (counter - 1)), maxTimeout);
console.log('[fetch retry]', 'schedule retry', { statusCode, retryTimeout, errorCode, url: opts.origin });
// eslint-disable-next-line sukka/prefer-timer-id -- won't leak