3 ms·
You might want to replace the `openOrders.forEach ...` call with a call to `await Promise.all(openOrders.map ...)` if you want to catch errors and stop the prog
by gildas 7y ago
You might want to replace the `openOrders.forEach ...` call with a call to `await Promise.all(openOrders.map ...)` if you want to catch errors and stop the program when cancelling previous orders, and more importantly make sure you cancel orders before doing anything else.
- thomasfromcdnjs 7y agoThanks for the tip, I didn't actually know that technique.
- gildas 7y agoYou're welcome. Alternatively, you could simply use "for of" but the requests won't be sent in parallel.