Google Script Error: Exceeded Maximum Execution Time

1,078 views
Skip to first unread message

Cameron Coile

unread,
Apr 23, 2020, 11:30:26 AM4/23/20
to Google Apps Script Community
Just recently my google script has been returning an error message of Exceeded Maximum Execution Time. I've been running the script for months and have never had any issues until last week. It errors out usually in the morning but will run just find by mid-day. Nothing has changed in the script since I first wrote it.

Does anyone know why this might be happening?


Alan Wells

unread,
Apr 23, 2020, 11:44:29 AM4/23/20
to Google Apps Script Community
It's not unusual for a script to run for some time, and then get quota errors all of a sudden.  I have no idea why.  I don't know if Google, kinda, "let's it go for a while", and then "reigns you in".  Or maybe they are just slow at figuring out that you're over quota.  All I know is, that I've heard the same complaint that you are experiencing quite a few times.  So, "Why does it happen?"  Who knows?  But, about all you can do is optimize your code, and make sure that you are throttling service calls in situations where you have service calls in a loop.  So, do you have service calls inside of a loop?  The classic example is setting Sheet cell values individually, one per loop.

Andrew Roberts

unread,
Apr 24, 2020, 4:44:07 AM4/24/20
to google-apps-sc...@googlegroups.com
If you can't optimise the code look at automatically restarting it with the CBL library.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/733f85c2-3164-41dd-82d1-5fe8db5196cb%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages