4 ms·
I agree with you, and I’d like your opinion on working around the cpu budgeting. Whenever I’ve needed to run a long task, like exporting gmails , I’ve needed t
by tonymet 2y ago
I agree with you, and I’d like your opinion on working around the cpu budgeting. Whenever I’ve needed to run a long task, like exporting gmails , I’ve needed to run it via a web browser on a loop.
Have you found a workaround for long-running tasks that isn’t terribly complex?
- adobrawy 2y agoI'm not sure what operations you're doing that you're CPU bound. When exporting Gmail and hitting an execution timeout, I would implement partitioning by date. Google Apps Script has a lock mechanism ( https://developers.google.com/apps-script/reference/lock https://developers.google.com/apps-script/reference/lock ), and you can use user properties for progress tracking ( https://developers.google.com/apps-script/reference/properties/properties-service#getUserProperties https://developers.google.com/apps-script/reference/properti...() ). Therefore, you can schedule a task every x minutes to pull x days of data and keep the cursor in user properties.
- tonymet 2y agoYeah that’s what I mean. Another trick I’ve used is building a web page that reloads itself because interactive calls have more generous quotas