[英]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.