简体   繁体   English

如何解决Google App脚本中插件的时间触发限制?

[英]How to get around time trigger limitations for Add-Ons in Google App Script?

I want to develop an Add-On to Google Sheets that gets statistics from multiple APIs every 15 minutes (at least). 我想开发一个Google表格加载项,至少每15分钟从多个API获取一次统计信息。

I use time triggers for this in my script (which I want to make into an add-on) and that is fine. 我在脚本中使用了时间触发器(我希望将其添加到附件中),这很好。

However, I read that an Add-On can only have a time trigger with a frequence of 1 hour. 但是,我读到一个加载项只能有一个频率为1小时的时间触发器。 This would make it impossible to make the Add-On as I need more frequent data than that. 这将使制作附加组件变得不可能,因为我需要的是比这更频繁的数据。

Are there any workarounds around this issue? 有没有解决此问题的方法?

Would it be feasible to have a script start and then continously add and delete a time trigger in some other way, like "run in 15 minutes again"? 启动脚本然后以其他方式连续添加和删除时间触发器是否可行,例如“再次运行15分钟”?

As it's stated in the documentation for the Add-ons triggers, you can't set it for less than an hour [1]: 正如插件触发器文档中所述,您不能将其设置少于一小时[1]:

Time-driven triggers cannot run more frequently than once per hour. 时间驱动的触发器不能每小时运行一次以上。

Also, they can't have more than one type of trigger at the same time, meaning you could only have one time-driven trigger [1]: 另外,它们不能同时具有多种类型的触发器,这意味着您只能具有一种时间驱动的触发器[1]:

Each add-on can only have one trigger of each type, per user, per document. 每个用户,每个文档每个附件只能具有一个触发器。 For instance, in a given spreadsheet, a given user can only have one edit trigger, although the user could also have a form-submit trigger or a time-driven trigger in the same spreadsheet. 例如,在给定的电子表格中,给定的用户只能具有一个编辑触发器,尽管该用户在同一电子表格中也可以具有表单提交触发器或时间驱动触发器。 A different user with access to the same spreadsheet could have their own separate set of triggers. 具有相同电子表格访问权限的其他用户可以拥有自己独立的一组触发器。

Conclusion: I don't see any workaround possible for this. 结论:我看不出有任何解决方法。

[1] https://developers.google.com/gsuite/add-ons/concepts/triggers [1] https://developers.google.com/gsuite/add-ons/concepts/triggers

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

相关问题 Google Apps脚本附加组件:可安装的触发器限制 - Google Apps Script add-ons: Installable trigger limitations 如何在Google表单中使用应用程序脚本或加载项 - How to use apps script or add-ons in Google Forms Google App Script Add-Ons createAddonMenu() 创建帮助菜单。 怎么称呼? - Google App Script Add-Ons createAddonMenu() create a Help menu. How to call it? 通过Google App脚本将Google Cloud Search集成到gmail插件中 - integrate google cloud search in gmail add-ons through google app script 我可以在gmail插件上调用基于时间的触发器吗? - can i call time based trigger on gmail add-ons? 使用插件或Google扩展程序在Google脚本中打印 - Print in google script using add-ons or Google extensions 将文件写入来自Google App Script服务器代码的附加组件上的Application Data Folder - Writing file to Application Data Folder on Add-ons from Google App Script server code 本地化 Google 插件 - Localizing Google Add-ons 如何使用脚本编辑器(谷歌文档插件)删除谷歌文档中的空行? - How to remove empty lines in a google doc using the script editor (Google Docs add-ons)? 发布Google Apps脚本附件的生命周期? - Lifecycle of publish Google Apps Script Add-ons?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM