删除不会再次运行的石英触发器
石英调度程序是否会删除不再运行的触发器,或者我们应该使用RemoveTrigger方法自己删除它们。我想在某个时间运行一个作业,但执行后该作业将不会再次运行。
Does the quartz scheduler remove the triggers that won't run again or we should remove them ourselves by using the RemoveTrigger method. I want to run a job at an instance of time but after execution that job won't run again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,默认情况下 Quartz 会删除已完成的触发器(不会再次触发)。您不需要手动删除它们,除非您设置了一个永不过期的触发器,例如 CronTrigger。
Yes, by default Quartz will remove triggers that are complete (will not fire again). You do not need to remove them manually unless you've set up a trigger that will never expire, like a CronTrigger, for example.
如果您使用 SimpleTrigger 安排作业,则无需手动将其删除。
如果您想自己检查,方法是将 Quartz 配置为使用数据库存储,以便您可以对触发器表运行查询。
http://www.quartz-scheduler.org/docs/configuration/ConfigJobStoreTX.html
If you scheduled your job using a SimpleTrigger, then you don't need to remove it manually.
If you want to check it by yourself, the way is to configure Quartz to use a database store, so that you can run a query against the triggers table.
http://www.quartz-scheduler.org/docs/configuration/ConfigJobStoreTX.html