Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Async.retry executes immediately before waiting for interval

async.retry({times : 25,interval : 30000},myFunction.bind(functionData),function(err,results){
console.log("===================================")
console.log("Async function finished processing")
return;
})

myFunction is called immediately and that too 5 times which is default. also there is no waiting period between calls

like image 465
Vikas Sharma Avatar asked Sep 12 '15 09:09

Vikas Sharma


1 Answers

This is a version issue I think.

Older versions of async.retry can only be called with a number as the first agument (eg see the v1.2.0 docs)

It does not accept the opts object. So if you pass it in instead of a number for the first argument, it defaults to no interval and a retry count of 5.

I had this same issue using v0.9.0 of the library, updating to v1.4.2 fixed the issue.

like image 195
James Skinner Avatar answered Oct 11 '22 14:10

James Skinner