UoaWDCC / uasc-web

Project with the University of Auckland Snowsports Club Website & Booking System. Established in 2023.
https://uasc.co.nz
6 stars 2 forks source link

[BACKEND] Use Promise.all instead of for loop in fetch-users #459

Closed bcho892 closed 4 months ago

bcho892 commented 4 months ago

Is your feature request related to a problem? Please describe.

introduced in #415 was a method to fetch users between a date. while doing #457 we notice there was super slow querying on larger date ranges, and it became apparent that it was because we were doing blocking async calls in a for loop, not taking advantage of concurrency.

We should replace it with a Promise.all

Further reading: https://stackoverflow.com/questions/53798589/await-loop-vs-promise-all

BEFORE MERGING