Actually simplify the while look condition

This commit is contained in:
2026-07-13 02:21:37 +00:00
parent 452f5acdd5
commit f346a1fc4f

View File

@@ -88,7 +88,7 @@ export class ExponentialBackoff {
// If the max attempts is 0, we should continue indefinitely.
const unlimitedAttempts = this.options.maxAttempts === 0;
while (attempt < this.options.maxAttempts || unlimitedAttempts) {
while (unlimitedAttempts || attempt < this.options.maxAttempts) {
try {
// Await the promise before returning so its execution context remains in the try-catch
// If we didn't await, this `run` function would successfully return and any errors would not be caught here.