I have a web crawler that is working fine, but i have an issue. What I basically need is when I reach 90 requests I need to give a timeout of 5 or more minutes.
my example code:
for (let i=0; i < maxPag; i++) {
setTimeout(function(){
console.log(i);
getInfoPage(i);
}, 15000 * (i+1));
}
For example in the example above i give a timeout but is for the page that is requested, but after 90 requests, i need to have like a bigger timeout, this happens in all times that i reach in 90 requests.
How can i make a interval in the 90th request, than in 180th request, and goes on untill my for loop ends.