sindresorhus / p-limit

Run multiple promise-returning & async functions with limited concurrency
MIT License
2.06k stars 106 forks source link

I can't seem to use nested limit() function #14

Closed mledwards closed 5 years ago

mledwards commented 5 years ago

So I have a Promise.all that's mapping an array to a limit, that's calling a function. In that function I have another Promise.all that I want limited, but it seems to never get into the second limit function call.

Any ideas?

mledwards commented 5 years ago

Ah, I see my problem. I was limiting to 1 concurrent request. So a nested Promise.all needs at least 2 concurrent requests. Working a treat. Thanks!