async
async copied to clipboard
only first of async.series function gets called
Considering this code, only the first function body is executed.
async.series([
function(cb) {
let a = 1
cb()
},
function(cb) {
let b = 2;
cb()
}
], function(err) {
console.log('test')
})
If I change series to parallel, every function body is executed.
async.parallel([
function(cb) {
let a = 1
cb()
},
function(cb) {
let b = 2;
cb()
}
], function(err) {
console.log('test')
})
I'm using this inside an function which is being called inside another async.series, so its basically this:
function outer() {
async.series([
function(cb) {
inner(cb);
},
function(cb) {
let b = 2;
cb()
}
], function(err) {
console.log('outer test')
})
}
function inner(callback) {
async.series([
function(cb) {
let a = 1
cb()
},
function(cb) {
let b = 2;
cb()
}
], function(err) {
console.log('inner test')
callback()
})
}
In outer all function bodies in async.series get executed.
Tested it isolated and it works fine.
Works for me also Thanks