Skip to content

Commit

Permalink
fix: respect max retry in http get
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobiah committed Jul 26, 2019
1 parent 23cb0b8 commit b27df82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsoncache.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class JSONCache extends EventEmitter {

if (response.statusCode < 200 || response.statusCode > 299) {
if ((response.statusCode > 499 || retryCodes.indexOf(response.statusCode) > -1)
&& this.retryCount < 30) {
&& this.retryCount < this.maxRetry) {
this.retryCount += 1;
// eslint-disable-next-line no-console
setTimeout(() => this.httpGet().then(resolve).catch(console.error), 1000);
Expand Down

0 comments on commit b27df82

Please sign in to comment.