首页 文章

如果匿名用户退出,实现用户创建的触发器然后删除它的程序流程是什么?

提问于
浏览
0

我的应用程序是从谷歌网站调用的 .

网站链接是公开的 . 用户单击链接以运行公共脚本 .

公共脚本doGet()创建一个新的电子表格,并充满了公式 . 还会创建一个onEdit触发器,以便当用户对电子表格进行更改时,会运行一些其他项目库函数并将答案返回给用户电子表格 .

用户完成工作,退出或断开连接 . 无论如何,用户已经杀死了运行该站点(容器页面)和电子表格的浏览器 .

确定触发器不是't show up in my (owner) project'的触发器列表 . 所以我很确定 - 并且google脚本指南seem to also say this - 触发器属于用户的项目空间 . 现在触发器是孤立的 .

What's the program flow to be able to implement a user-created trigger and then delete it if the user quit?

我想我可以忽略孤立的触发器 - 除非用户每天返回到站点并最终从doGet()创建了太多的触发器 .

So is it typical for google-apps to leave triggers orphaned and if you want to prevent too many triggers from frequent users, you look for old user-created triggers for that project in the doGet() before you re-create them?

谢谢!

1 回答

  • 0

    当你创建触发器时,你也可以创建一个定时器触发器,它会在一段时间后杀死自己和所有同伴触发器...不理想但没有经过测试但它应该可以工作 .

相关问题