Actually simplify the while look condition
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user