Handling Gmail Addon Timeouts

一笑奈何 提交于 2020-07-09 12:52:26

问题


I'm trying to upload a larger size document from a gmail add on but I keep getting "Gmail could not perform this add-on action" when I try to hit my endpoint because it takes too long and I "Exceeded maximum execution time" of 30 seconds. Is there a way to increase the maximum execution time or at least catch the error and display something else other than Gmail's runtime error message?


回答1:


I found some Google documentation that sheds light on this issue. Check out the Callback Function section of this page. Card Service limits your callback function execution time to 30 seconds.

You may have to settle for Tom's answer. I'd also add size restrictions to the files that you're working with so that you can rule out files that are obviously too large for Card Service. I'd be interested, though, if you found a better solution than this.




回答2:


If you have a log method that you call often, you could add a check like "If the script is running since more than 25s, throw."



来源:https://stackoverflow.com/questions/51162945/handling-gmail-addon-timeouts

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