Google Apps Script trigger quota and limitations

白昼怎懂夜的黑 提交于 2019-12-12 06:23:02

问题


I use form submit trigger for my form which does some processing on my spreadsheets. The form submit process may take a while to complete(approximately 30secs). As responses are submitted in the form the trigger's processing time may exceed the quota of triggers run time which is 6 hours for Google Apps Work/Edu/Gov. Also the number of triggers per script limit is 20.

Are there any workarounds for these problem.


回答1:


It may depend on what type of quota it is. Provided in this document - Best Practices, a list that will help you improve the performance of your scripts.

  • Minimize calls to other services
  • Use batch operations
  • Avoid libraries in UI-heavy scripts
  • Use the Cache service

Also, a blog about Google Apps Script talks about nearly all workarounds for the quotas will increase the code complexity like adding delays, increasing the intervals of each functions and splitting of script into smaller parts.

Hope this helps.




回答2:


There are a few methods I can think of:

1) Use another service to do batch processing. This could be something like App Engine, Google functions, or some other service.

2) Create batch processing user accounts in your domain. Each one will have their own 6 hour quota limit. Your form submit trigger would build a request and send it to one of the batch processing accounts. Note these accounts would need access to any resources required by the script.

3) Open a Google Apps Script issue requesting more processing time. I have no specific information, but I've heard some very heavy users can purchase "pro" support for apps script that includes longer run times.

4) Shave time off your script. Figure out why it needs a full 30 seconds to process and see if you can reduce that work load.



来源:https://stackoverflow.com/questions/40486845/google-apps-script-trigger-quota-and-limitations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!