▲ | whilenot-dev a day ago | |||||||||||||||||||||||||
> Time to fetch version data for each one of those packages: ~12 hours (yikes) The author could improve the batching in fetchAllPackageData by not waiting for all 50 (BATCH_SIZE) promises to resolve at once. I just published a package for proper promise batching last week: https://www.npmjs.com/package/promises-batched | ||||||||||||||||||||||||||
▲ | winrid a day ago | parent | next [-] | |||||||||||||||||||||||||
What's the benefit of promises like this here? Just spin up a loop of 50 call chains. When one completes you just do the next on next tick. It's like 3 lines of code. No libraries needed. Then you're always doing 50 at a time. You can still use await. async work() { await thing(); nextTick(work); } for(to 50) { work(); } then maybe a separate timer to check how many tasks are active I guess. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | 1gn15 a day ago | parent | prev | next [-] | |||||||||||||||||||||||||
Worried about being rate limited or DoSing the server. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | genshii a day ago | parent | prev [-] | |||||||||||||||||||||||||
Ah this is cool, thanks! |