Closed battis closed 1 year ago
Probably the pragmatic solution is for the script to be aware of its own time limit and to note at, say, 25 minutes, where it's at, and to essentially recall itself from where it left off as a new instance.
From #82:
Don't need to copy the existing history into the data sheet. Can just have a template sheet that has a single field for the host ID and copy values from it.
From #81:
Updates seem to be timing out as well (see https://github.com/groton-school/course-planning-tool/issues/72). Need to be able to pick them up from where they timed out.
I think the approach here is for these long processes page them. They need to time how long it takes to perform each iteration of the operation, and to track where they are against the Google Apps Script timing limits. When they get within 1-2 "iterations" of the time limit, our progress bar needs to accept a new "partial" complete that links to the next "page" of the process.
The actual number isn't totally consistent, which makes me think that the script is actually timing out. (In fact, examining the logs confirms this: 30min time-out.) Need to find a way to parallelize this.