You seem to be passing 2 args to your addresses.map() callback ( can't tell
exactly on phone:(). But if you do, the second arg is simply used as function
context ('this'). You don't use it so it's never called.
Perhaps try something different:
Promise.all(addresses.map (item => getMap(item))
.concat (addresses.map(item => getSateliteMap(item)));
That would fire all requests in parallel, so maybe you should make sure to
limit your batch size. Probably a wrapper for this function which chunks up the
array into batches and runs the batches in series, and informs the original
request when everything was returned.
Additionally you might consider not rejecting that error; that seemingly
terminates all other requests without waiting for their results. Maybe instead
write down which reqs failed and in the end you will have more details on how
things went.
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/d46c42e7-7704-4da1-b68c-1a8e8b99e55f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.