问题
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