fix: maxRetry hit infinite loop with negative input

This commit is contained in:
peterwoodworth
2023-08-11 16:24:09 -07:00
parent 65c2143642
commit 7f4507af3c
5 changed files with 30 additions and 5 deletions
Generated Vendored
+1 -1
View File
@@ -17699,7 +17699,7 @@ async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, ba
// It's retryable, so sleep and retry.
await sleep(Math.random() * (Math.pow(2, retries) * base));
retries += 1;
if (retries === maxRetries) {
if (retries >= maxRetries) {
throw err;
}
return await retryAndBackoff(fn, isRetryable, maxRetries, retries, base);