服务调用次数过多:触发器

发布于 2024-10-17 16:51:39 字数 466 浏览 1 评论 0原文

我们正在尝试实施一套电子表格来处理一组商店的预算数据。一切工作正常,直到我们尝试实现一个电子表格,该电子表格将从所有商店电子表格收集数据并显示统计数据。由于 ImportRange 的限制(每个电子表格文档最多使用 50 次),我们一直在实施 Google 文档脚本来处理数据的导入。但现在,当我们制作了一份文档副本以供每个月使用时,我们遇到了时间触发器的问题。我们设置了一个触发器,每分钟运行一次脚本,这会导致一条错误消息: 服务调用次数过多:触发器

这里有什么限制?我们如何最好地解决这个问题?

我们还收到一些其他错误消息,并想知道如何解决这些问题;

  • 文档 tEHGO48zIBIFYRpb7Xhjwqg 丢失(也许已被删除?)(第 191 行)
  • 超过最大执行时间
  • 服务错误:电子表格(第 290 行)

我们在哪里可以找到描述不同限制和错误消息的文档?

We are trying to implement a suite of spreadsheets that will handle budget figures for a set of stores. Everything works fine until we try to implement a spreadsheet that will collect data from all store spreadsheets and present statistics. Due to the limitation of ImportRange, of a maximum of 50 uses per spreadsheet doc, we have been implementing a Google docs script instead to handle the importing of data. But now when we have made a copy of the document to have one for each month, we are getting problems with our time triggers. We have setup a trigger to run the script once every minute and that results in an error message stating; Service invoked too many times: trigger.

What are the limitations here? And how do we best solve this?

We are also getting some other error messages and would like to know how to solve these;

  • Document tEHGO48zIBIFYRpb7Xhjwqg is missing (perhaps it was deleted?) (line 191)
  • Exceeded maximum execution time
  • Service error: Spreadsheets (line 290)

Where can we find documentation describing the different limitations and error messages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

妞丶爷亲个 2024-10-24 16:51:39

与 Google Apps 脚本一起使用的许多服务的配额限制现已发布在信息中心上,网址为:

https://docs。 google.com/macros/dashboard

Quota Limits for many services used with Google Apps Scripts have now been published on the Dashboard at:

https://docs.google.com/macros/dashboard

可可 2024-10-24 16:51:39

刚刚发生在我身上同样的事。似乎有一个未发布的限制

Premier 帐户通常对每种限制都有较大的配额。
争论的焦点是该帐户得到了更好的验证,并且不太可能利用资源。

但 Google 并未公布常规限制或 Premier 的更好配额。而且 Google 员工似乎也不能在论坛上这么说。唯一明确定义的 GAS 限制是电子邮件配额,可通过以下方式访问:
MailApp.getRemainingDailyQuota()
普通帐户为 500,Premier 帐户为 1500。

来源:Google支持论坛

解决方案是:

  • 如果触发器数量有限,则将多个脚本加入到一个大触发器中
  • 如果基于 CPU 使用情况,则优化代码(加入循环、仅刷新必要的字段等)
  • 尽可能将分钟计时器触发器移至 OnEditOnOpen 触发器
  • 获取高级帐户

对于您的其他错误,我还没有遇到任何类似的情况。您应该发布一些有关脚本的详细信息或发布一些代码,以便我们可以对其进行调试。

Just happened the same to me. It seems there is a non-published limit:

Premier accounts usually have larger quotas for every limitation.
The argument is that the account is better verified and less likely to exploit to resources.

But neither the regular limitations or Premier's better quotas are published by Google. And it seems that Googlers can't say it here in the forums either. The only well defined GAS limitation is the email quota, accessible through:
MailApp.getRemainingDailyQuota()
Which is 500 for regular accounts and 1500 for Premier.

Source: Google Support forums

Solutions are:

  • Join several scripts into one big trigger in case there is a limit in number of triggers
  • Optimize code (join loops, refresh only the necessary fields, etc.) in case it is based in CPU usage
  • Move minute timer triggers to OnEdit or OnOpen triggers whenever possible
  • Get a Premium Account

For your other errors, I haven't encountered any similar. You should post some details on the script or publish some code so we can debug it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文