Answer the question
In order to leave comments, you need to log in
What is the best way to send data at intervals?
An array with data comes from the front (about 100-200 username values).
Then, using this array, I make a request to Mongo.
Monga gives a new array (of user id).
I then need to send a request to the public api.
The public api does not allow you to send an array at once, but only one value per request.
It also has a limit of 30 requests per second.
From the ideas so far, split the input array into several 30 elements each, and send them in a loop through settimeout per second
.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question