I have this for loop in my node.js application:
for (var runNumber=1; runNumber<=numberOfRuns; runNumber++) {
runNumberQueue.place(function(){
versionRunningService.runMultiVersionJobs(
queue, jobId, sVersion, jobType, runNumber, currentConfig, allJobsConfig, appDir, function(){
runNumberQueue.next();
currentIterationCount++;
if (currentIterationCount === numberOfIterations) {
callback();
}
});
});
}
Is there somethingwrong with the structure of it? It seems to increment runNumber
then execute the runNumberQueue.place
function with runNumber
1, skip execution of runNumberQueue.place
for runNumber
2 and execute again correctly for runNumber
3.
I wondered if it could be some asynch issue either but think that runNumberQueue.place
would execute with runNumber
2 at some stage?