We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 127efbb commit cf8278cCopy full SHA for cf8278c
2 files changed
.changeset/olive-ghosts-help.md
@@ -0,0 +1,5 @@
1
+---
2
+"@badrap/libapp": patch
3
4
+
5
+Switch from Math.max to Math.min on retry backoff calculation
src/api/index.ts
@@ -219,7 +219,7 @@ export class API<
219
if (attempt >= maxRetries) {
220
throw new UpdateFailed(err);
221
}
222
- const backoff = Math.max(backoffStep * 2 ** attempt, maxBackoff);
+ const backoff = Math.min(backoffStep * 2 ** attempt, maxBackoff);
223
await sleep(backoff * (1 + Math.random() * jitterFactor));
224
continue;
225
0 commit comments