#I'm iterating through a list of 1000 and each value will be used as a separate request
4 messages · Page 1 of 1 (latest)
Yes, you are going to effectively try and DDoS the server. I suggest throttling using eg. p-throttle:
const throttle = pThrottle({
limit: 10,
interval: 1000
})
await Promise.all(thousandValues.map(throttle(async value => {
const response = await fetch(value)
/* whatever */
}))
*DoS, to be pendantic
what I ended up doing was sending each request synchronously