I am trying to process and update query for 1000 items at a time. I tired settings cache to false, and even tried setTimeout to have a pause between requests. Each request should take 5-6 seconds and then the process will never timeout, but after 4-5 requests it reaches server execution limit.
The problem is I need to use PHP objects in my update query. every request seems to take longer so it seems the objects are looping in PHP
Is there anyway to stop this happening?
Here is the javascript code
function processIndex() {
$.ajax({
url: responder,
dataType: "json",
data: data,
cache: false,
async: false,
error: function(XMLHttpRequest, textStatus, errorThrown){
// alert('status:' + XMLHttpRequest.status + ', status text: ' + XMLHttpRequest.statusText + ' LIMIT ' + limitFrom + ', ' + limitTo);
limitFrom = limitTo;
limitTo += 1000;
processIndex('indexPrices');
},
success: function(data) {
limitFrom = limitTo;
limitTo += 1000;
setTimeout(function() {
processIndex();
}, 1000);
}
});
}
});
}