Skip to content

Commit

Permalink
Merge pull request #5 from practio/fix-use-delay-opts-on-callback
Browse files Browse the repository at this point in the history
Fix to respect delay option when using callback
  • Loading branch information
Jonathan M. Hethey committed Nov 13, 2019
2 parents e22db8b + 3d9cff3 commit 8c003b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ node_js:
- 4.2
- 6
- 8
- 10
- 12
sudo: false
after_success: "npm run coveralls"
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ function verbFunc(verb) {
callback.apply(this, arguments);
} else {
attempts++;
return request(params, params.callback);
logFunction(err || 'request-retry-stream is retrying to perform request');
return setTimeout(() => {
request(params, params.callback);
}, attempts * delay);
}
};
attempts++;
Expand Down

0 comments on commit 8c003b2

Please sign in to comment.