Google Apps Script Service Using Too Much Computer Time for One Day

后端 未结 2 735
再見小時候
再見小時候 2020-12-18 16:32

So I got the error message in the subject on the 1 (one) script I had running yesterday and I am assuming I will get a similar message today.

I have improved the scri

相关标签:
2条回答
  • 2020-12-18 16:53

    Every call to a service (Spreadsheet, Calendar or whatever) takes more time than regular JavaScript operations. For example, if you have to modify 10 cells in a Spreadsheet, calling range.setValue() 10 times takes far more time than having all the data in an array and then updating the spreadsheet in one go using range.setValues().

    If you can paste pieces of your code, the community will be able to offer more advice on how to improve your script.

    0 讨论(0)
  • 2020-12-18 16:53

    The limit is on CPU time used in time based triggers, and I believe those sleep calls are counted against your limit. I'd encourage you to find ways to avoid the sleep calls, or schedule your script to run less often.

    0 讨论(0)
提交回复
热议问题