the LongRun class supports to execute long-running Google Apps Scripts. (A spin-off from GAS-Terminal)
Related article is here.
If you use clasp and TypeScript, download LongRun.ts and put it in your clasp project. (I assume you know how to push it to the Apps Script environment.)
If you don't use clasp, but use Apps Script Editor, follow these steps.
- Open Apps Script Editor.
- Add a new Script file named LongRun.gs.
- Copy the contents of this file and paste it into LongRun.gs you created.
See the Test1.ts or Test2.ts to know how to use this class.
( If you want generated script files instead of the TypeScript files, see Test1.gs or Test2.gs )
See this page.