Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 436 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 436 Bytes

retry-as-promised

$ npm install --save retry-as-promised

Retry a failed promise

var retry = require('retry-as-promised');

// Will call the until max retries or the promise is resolved.
return retry(function () {
  return promise;
}, {
  max: 3, // maximum amount of tries, default: 1
  timeout: 10000 // throw if no response or error within milisecnd timeout, default: undefined
});

Tested with

  • Bluebird