Hacker News new | ask | show | jobs
by tonymet 600 days 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?

1 comments

I'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 ), and you can use user properties for progress tracking ( 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.

Yeah 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