在 Grails 中禁用 Quartz 作业

发布于 2024-08-02 06:18:09 字数 133 浏览 4 评论 0原文

我在 Grails 中使用 Quartz 插件。是否有一种配置可以用来禁用该作业,而无需注释或删除整个文件?

I am using the Quartz plugin in Grails. Is there a configuration that I can use to disable the job, without commenting out or deleting the whole file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

黑寡妇 2024-08-09 06:18:09

作为解决方法,您可以让作业检查配置选项,或查询数据库,并且如果不应该这样做,则不执行其操作。

as a workaround, you could make the job check a configuration option, or query the DB, and just not do its thing if its not supposed to.

婴鹅 2024-08-09 06:18:09

我相当确定当前版本的 Quartz 中不存在此功能。然而,有一个补丁可以实现作业取消和重新安排,因此它似乎有可能在(不久?)的将来添加到正式版本中。有关详细信息,请参阅此电子邮件线程。如果您想亲自尝试该补丁,可以在错误跟踪器上找到它。

I'm fairly certain this functionality does not exist in the current version of Quartz. However there is a patch that implements job cancellation and rescheduling, so it seems plausible that it will be added to the official release in the (near?) future. See this email thread for details. If you want to try the patch yourself, it can be found on the bug tracker.

时间你老了 2024-08-09 06:18:09

我不知道这是否仍然相关,但是添加一个 return 语句作为execute() 方法中的第一行怎么样?

I don't know if this is still relevant, but how about adding a return statement as the first line in the execute() method?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文