Skip to content

Commit

Permalink
fix: respect totalTimeout and do not retry if nextRetryDelay is <= 0 (#…
Browse files Browse the repository at this point in the history
…38)

* fix: respect totalTimeout and do not retry if nextRetryDelay is <= 0

* linter fix
  • Loading branch information
ddelgrosso1 committed Jun 7, 2022
1 parent c8da29d commit 9501a42
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Expand Up @@ -186,6 +186,11 @@ function retryRequest(requestOpts, opts, callback) {
});
debug(`Next retry delay: ${nextRetryDelay}`);

if (nextRetryDelay <= 0) {
numNoResponseAttempts = opts.noResponseRetries + 1;
return;
}

setTimeout(makeRequest, nextRetryDelay);
}

Expand Down

0 comments on commit 9501a42

Please sign in to comment.