backoff-time
v1.0.0
Published
Zero deps backoff time
Downloads
2
Readme
backoff-time
Zero deps backoff time function
Install
$ npm install backoff-time
Usage
const minBackoff = 50;
const maxBackoff = 5000;
const backoff = require('backoff-time')(minBackoff, maxBackoff);
var attempt = 0;
function blah(...){
}
// every time blah fails we increment *attempt*
const wait = backoff(attempt);
// retry
setTimeout(fn, wait);