简体   繁体   English

谷歌应用程序脚本中的错误

[英]Error in google apps script

My google apps script is getting the error below.我的谷歌应用程序脚本收到以下错误。 I've been running it for a few weeks and it's been working just fine, but last night it started giving these errors.我已经运行它几个星期了,它运行得很好,但昨晚它开始出现这些错误。 I didn't change anything in the script or spreadsheet, so I'm pretty sure it's a problem in Google's infrastructures.我没有更改脚本或电子表格中的任何内容,因此我很确定这是 Google 基础架构中的问题。 Can someone help me to fix this problem?有人可以帮我解决这个问题吗? Thank you.谢谢你。

====================== ======================

Your script, Test Script, has recently failed to finish successfully.您的脚本测试脚本最近未能成功完成。 A summary of the failure(s) is shown below.故障摘要如下所示。 To configure the triggers for this script, or change your setting for receiving future failure notifications, click here.要为此脚本配置触发器,或更改接收未来失败通知的设置,请单击此处。

The script is used by the document Script test 2.该脚本由文档脚本测试 2 使用。

Summary:概括:

Error Message Count错误消息计数

Too many simultaneous invocations: Spreadsheets (line 22, file "Code") 4 We're sorry, a server error occurred.太多同时调用:电子表格(第 22 行,文件“代码”) 4 很抱歉,发生服务器错误。 Please wait a bit and try again.请稍等,然后重试。 (line 16, file "Code") 3 Details: (第 16 行,文件“代码”) 3 详细信息:

Start Function Error Message Trigger End启动函数错误信息触发结束

9/6/16 8:00 AM runAll Too many simultaneous invocations: Spreadsheets (line 22, file "Code") time-based 9/6/16 8:02 AM 9/6/16 8:02 AM runAll We're sorry, a server error occurred. 9/6/16 8:00 AM runAll 太多同时调用:电子表格(第 22 行,文件“代码”)基于时间 9/6/16 8:02 AM 9/6/16 8:02 AM runAll 我们是抱歉,发生服务器错误。 Please wait a bit and try again.请稍等,然后重试。 (line 16, file "Code") time-based 9/6/16 8:03 AM 9/6/16 8:05 AM runAll Too many simultaneous invocations: Spreadsheets (line 22, file "Code") time-based 9/6/16 8:06 AM 9/6/16 8:04 AM runAll We're sorry, a server error occurred. (第 16 行,文件“代码”)基于时间的 9/6/16 8:03 AM 9/6/16 8:05 AM runAll 太多的同时调用:电子表格(第 22 行,文件“代码”)基于时间的 9 /6/16 8:06 AM 9/6/16 8:04 AM runAll 很抱歉,发生服务器错误。 Please wait a bit and try again.请稍等,然后重试。 (line 16, file "Code") time-based 9/6/16 8:07 AM 9/6/16 8:07 AM runAll Too many simultaneous invocations: Spreadsheets (line 22, file "Code") time-based 9/6/16 8:10 AM 9/6/16 8:13 AM runAll We're sorry, a server error occurred. (第 16 行,文件“代码”)基于时间的 9/6/16 8:07 AM 9/6/16 8:07 AM runAll 太多的同时调用:电子表格(第 22 行,文件“代码”)基于时间的 9 /6/16 8:10 AM 9/6/16 8:13 AM runAll 很抱歉,发生服务器错误。 Please wait a bit and try again.请稍等,然后重试。 (line 16, file "Code") time-based 9/6/16 8:14 AM 9/6/16 8:14 AM runAll Too many simultaneous invocations: Spreadsheets (line 22, file "Code") time-based 9/6/16 8:17 AM Sincerely, (第 16 行,文件“代码”)基于时间的 9/6/16 8:14 AM 9/6/16 8:14 AM runAll 太多的同时调用:电子表格(第 22 行,文件“代码”)基于时间的 9 /6/16 上午 8:17 真诚的,

Google Apps Script Google Apps 脚本

Need help?需要帮忙? Visit the Google Apps Script documentation.访问 Google Apps 脚本文档。 Please do not reply to this message.请不要回复这个信息。 (c) 2016 Google (c) 2016 年谷歌

I've run into a similar problem before with time-triggered scripts.我之前在使用时间触发的脚本时遇到过类似的问题。 When I was looping through many items in Google Drive, it seemed to throw this type of error when it was going through too many heavy calls too quickly.当我在 Google Drive 中循环浏览许多项目时,它似乎会在过快地进行过多繁重调用时抛出此类错误。

Interesting that it started happening after working correctly for weeks.有趣的是,它在正常工作数周后开始发生。

I don't know any of your original code, but if it involves fast/intense/numerous loops, try putting a delay every few iterations.我不知道您的任何原始代码,但如果它涉及快速/密集/大量循环,请尝试每隔几次迭代延迟一次。 Maybe once every 25 loops if there are hundreds of iterations, or a small delay at the end of each loop if there aren't so many.如果有数百次迭代,可能每 25 次循环一次,或者如果没有这么多迭代,则在每个循环结束时会有一个小延迟。

See if slowing down the code a little bit helps.看看减慢代码是否有帮助。 It's dirty, but it was the only reliable method which worked for me.它很脏,但它是唯一对我有用的可靠方法。 Otherwise, try optimizing your code to make less calls?否则,尝试优化您的代码以减少调用次数?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM