I have an XMLHttpRequest which loops however many times as the user wants, this works fine. However when I go past the number of 5000 it just doesn't finish? I selected 10,000 and left it to run to find it had only actually looped 5700(ish) times, no errors occur it just acts as though everything is finished correctly.
The XMLHttpRequest is linked to my API and a row is then inserted into a database (SQLite) for each loop, but when I check the database after it has finishing looping the requests, the correct amount is not always present? Below is the code which loops the XMLHttpRequest which is located in the function 'post()'I am not sure if this is a problem on the client side or server side? As everything works.. it just doesn't do the correct amount of requests when the number gets too large.
function send_requests(){
var request_number = document.getElementById("request_amount").value;
//loop for number of requests selected
for (var x=0; x < request_number; x++){
post();
}
}
via user7863941
No comments:
Post a Comment