(My target is clarify my concept about the problem, not code)
I want execute a array of promises sequentially, but nodeJS throw a strange error about many promises executed in parallel.(Because i limited that array to 20 promises and works, 50 promises and works, but 9000 promises and explode..)
- I know that we have some solutions like, array.reduce(), loops, etc
- I know about the promises states (my array have pending promises initially)
My question: I can execute 20 promises, then another 20 promises, etc but... If im executing my promises sequentially, nodeJS must execute 9k promises without problem? I have a bad concept? My code is wrong?
(Im doubting because nodeJS wait some time before begin to resolve the promises)
My case: i trying download 9k+ images (with axios), then save each one and then wait 5 seconds sequentially. [download 1 image, save that image, wait 5 seconds, then download next image, save.., wait..., etc.. ] Possible?