简体   繁体   English

如何重新启动失败的 Google Apps 脚本触发器?

[英]How do I restart a failed Google Apps Script Trigger?

I have a lot of time-driven triggers that query my Cloud SQL server and update information in Google Sheets.我有很多时间驱动的触发器来查询我的 Cloud SQL 服务器并更新 Google 表格中的信息。

Today, I went over my daily quota and got the following error message:今天,我超过了每日配额并收到以下错误消息:

Jun 9, 2020, 7:37:11 AM Error   Service invoked too many times for one day: premium jdbc connection.

All of my triggers stopped firing at 7:40 am.我所有的触发器在早上 7 点 40 分停止发射。 It's now 1pm.现在是下午 1 点。 I can manually run all of my functions, and they finish without errors.我可以手动运行我的所有功能,并且它们完成时不会出错。 However, I've deleted and re-created triggers, and no triggers will run on my account.但是,我已删除并重新创建触发器,并且不会在我的帐户上运行任何触发器。 Do I need to wait 24 hours?我需要等待24小时吗? Is there somewhere else I can reset triggers?还有其他地方可以重置触发器吗? Do I need to create a new Apps Script Project?我需要创建一个新的 Apps 脚本项目吗?

As mentioned in comments, I waited until the rolling 24-hour quota refreshed (it was less than 24 hours).正如评论中提到的,我一直等到滚动的 24 小时配额刷新(不到 24 小时)。 The quota I was maxed out on seems to be a rolling 24-hour Usage Time, so it doesn't reset to zero, it just gives you additional Usage Time as old usage rolls off.我被最大化的配额似乎是滚动的 24 小时使用时间,因此它不会重置为零,它只是在旧使用量减少时为您提供额外的使用时间。

Helpful suggestion in comments - Create a master script to add/remove all triggers, calling the other scripts as libraries.评论中的有用建议 - 创建一个主脚本以添加/删除所有触发器,将其他脚本称为库。 This allows you to quickly Delete all triggers, wait for the quota to reset/refresh, and add triggers back slowly or all at once.这使您可以快速删除所有触发器,等待配额重置/刷新,然后缓慢或一次性添加触发器。 Otherwise you may have Triggers that continually fire as soon as your quota has room, thereby maxing out your quota again.否则,一旦您的配额有空间,您可能会不断触发触发器,从而再次最大化您的配额。

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

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