0👍
I believe this might be a cause of the for
loop not supporting async/await
.
That is, the for loop runs through all iterations without “awaiting” for the asynchronous code you are running to finish.
I recommend you take a look at something like bluebirds’s promise.map
function.
Source:stackexchange.com