Open
Description
Is there a way to stagger requests correctly? For example I have 140 total requests in my google sheet and I want to only do 14 requests/s
Would something like this work?
Utilities.sleep(waitTime);
function do_fetch_(url, params) {
if (params['contentType'] === "application/json" && typeof params['payload'] === 'object' ) {
params['payload'] = JSON.stringify(params['payload'])
}
const waitTime = Math.floor(Math.random() * 10);
Utilities.sleep(waitTime);
var response = UrlFetchApp.fetch(url, params)
return JSON.parse(response.getContentText());
}
Metadata
Assignees
Labels
No labels