Closed Vadko closed 1 year ago
Hi @Vadko! Thank you for your pull request.
I really appreciate your contribution and have made some modifications to the code to fix a bug in the asynchronous logic. Here are the changes:
Once again, thank you for your contribution, and please let me know if you have any questions or feedback.
Hey! Changes seems legit to me, thank you.
Reason for using queue implementation for updating order is to avoid sequence execution of updating order and instead update it in parallel batches with quantity of 20. Currently, when there is no lot of requests it could work stable, but for example if quantity of requests will increase to 50-70 for example this can reduce performance.
Oh, I see. I'll add it back.
But I think we shouldn't use await
here, as that will make the execution sequential. What do you think?
I think await here doesn't wait for execution of promises execution but instead just for adding promise to queue. But, anyway, await isnt required here.
Hi, after researching the TS doc, I found Queue.add
just forwards the promise that the input function returns, not returns a promise to join the queue, which I tested and found to be true. So I'll drop the await
here.
https://user-images.githubusercontent.com/9297785/221294664-11e866f6-a415-4614-a5ae-3c680dd1d4ab.mov