We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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()); }
The text was updated successfully, but these errors were encountered:
I found this solution to work quite well with the API im querying (from a guy in the api discord)
function do_fetch_(url, params) { if (params['contentType'] === "application/json" && typeof params['payload'] === 'object' ) { params['payload'] = JSON.stringify(params['payload']) } while (true) { try { var response = UrlFetchApp.fetch(url, params) return JSON.parse(response.getContentText()); } catch (ex) { Utilities.sleep(100) } } }
Sorry, something went wrong.
No branches or pull requests
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?
The text was updated successfully, but these errors were encountered: