Skip to content

Async.each / Async.eachSeries #1250

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
zevero opened this issue Jul 22, 2016 · 2 comments
Closed

Async.each / Async.eachSeries #1250

zevero opened this issue Jul 22, 2016 · 2 comments

Comments

@zevero
Copy link

zevero commented Jul 22, 2016

What version of async are you using?
upgrade from v1.5.2 to v2.0.0

Which environment did the issue occur in (Node version/browser version)
linux node 6.2.2

What did you do? Please include a minimal reproducable case illustrating issue.
async.each(addresses, function(address){ async db query / or lookup via google api})
addresses has 8000 entries.

What did you expect to happen?
It worked in v1.5.2 but did not work anymore in v2.0.0

What was the actual result?
Error: Maximum call stack size exceeded
I tried to change for async.eachSeries ... but it did not help.
I tried to set --max-stack-size=100000 or --stack-size=100000 but I use it via gulp ... so I am not sure if gulp really passes this on to node.

I just downgraded to v1.5.2 for now.
Thought it may be of interest to you since 2.0.0 just came out ...

@ex1st
Copy link

ex1st commented Jul 22, 2016

Pleas check this - #696

@zevero
Copy link
Author

zevero commented Jul 22, 2016

Thank you. This was very helpful.
Just for the record - here is how I solved my situation:

complete_addresses  = [];
async.each(addresses,function(address, cb) {
    db.address.getCoordsOrGeolookup(address, function(err,coords){
      if (err) throw new Error(err.message);
      complete_adresses.push({coords:coords, address:address);
      cb();
    });
}, cb_all_done);

I can use v2 now by replacing 3rd line with

 setImmediate(db.address.getCoordsOrGeolookup, address, function(err,coors){...})

Hurray!

@zevero zevero closed this as completed Jul 22, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants