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
  • Loading branch information
ddelgrosso1 committed Jul 16, 2021
1 parent f06f635 commit b6e76d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,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 b6e76d3

Please sign in to comment.