@house-agency/brewtils
Version:
The Brewery Node.js Utilities (brewtils)
13 lines (11 loc) • 561 B
Markdown
exporter
======
::javascript
//Use like this: -> filter_error_cb is OPTIONAL.
return function retry(func, maximum_retries, delay, filter_error_cb);
//func = function to be retried on ANY error
//maximum_retries = time it will retry to function when an error ocurres
//delay = time between retrying again.
//filter_error_cb = function that gets the error as an argument when an error occures.
Returning true will continue retrying (if there are attempts left)
Returning false will throw that error and stop retrying