1

In the following code InsertIntoDB is a recursive function. Problem is after one one call to InsertIntoDB it executes mainFn. I want to execute mainFn after InsertIntoDB is completely over.

This is my code:

async.series([
    function(callback) {
        insertIntoDB(obj);
        callback();
    },
    function(callback) {
        mainFn();
        callback();
    }
]);
blackmamba
  • 1,952
  • 11
  • 34
  • 59
  • For what I was looking for (cascading tree deletion) this link was useful: http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search – arcseldon Sep 27 '14 at 11:55

1 Answers1

0

maybe if you use async waterfall instead

https://github.com/caolan/async#waterfall

Pedro Fillastre
  • 892
  • 6
  • 10