Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript node retry promise.all

function retry(fn, retries=3, err=null) {
  if (!retries) {
    return Promise.reject(err);
  }
  return fn().catch(err => {
      return retry(fn, (retries - 1), err);
    });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #node #retry
ADD COMMENT
Topic
Name
7+4 =