I have a function that takes an email address from a cell A1, makes URLfetch to my API and returns a response to B1. After a few hundred requests the function freezes.
How can I optimize the script for thousands of API calls without freezing? Any suggestions are welcomed.
The function:
function startProcess(input) {
try {
var json = response.getContentText();
var data = JSON.parse(json);
var deliverableResult = data.deliverable;
if (deliverableResult == true) {
return [[deliverableResult]];
}
} catch (e) {
return "the mail server doesn't respond";
}
Utilities.sleep(1500);
}