0

I'm trying to reduce the rate at which I make calls to this endpoint as to avoid 429 server error due to rate limit.

As a quick and inefficient way just to get it working for now, I'd like to do this using setTimeout(), though wherever I put it I get errors.

Here is the code I'm trying to slow down with a 1 second delay between calls:

    const getStaticProps = async () => {
        Promise.allSettled(
            urlsList.map((url) => fetch(url).then((resp) => resp.json()))
        ).then(console.log);
    };
Lil Robots
  • 29
  • 6

0 Answers0