不使用 CRON 字符串的计划设置字符串
目前,我们在项目中使用 cron 字符串来设置 Quartz 作业。但由非开发人员的管理员设置似乎要么太过分,要么有点令人困惑。因此,我们尝试使用像这样的简单字符串,
each 1 seconds on MonTueWedThuFri between 00:01 and 23:59
是否有任何现有框架(或在 Quartz 中)我能够从该字符串中获取 cron 字符串? (我知道我可以解析它以获得一个简单的触发器,但不想干)
Currently we are using cron strings for setting Quartz jobs in our project. But it seems to be either overkill or little confusing to set by a admin guy who is not a developer. So, we try to use a simple string like this,
each 1 seconds on MonTueWedThuFri between 00:01 and 23:59
Is there any existing frameworks (or in Quartz) I will be able to get a cron string out of this string? (I know i can parse this to get a simple trigger, but don't want to DRY)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知目前还没有。您的示例不仅仅适用于 SimpleTrigger,您还需要一个日历来消除周末的触发。因此,在这种情况下,CronTrigger 可能就是您正在寻找的东西。
但回到最初的问题...可能没有任何针对 Quartz(.NET) 的东西,它很快就会证明自己是不平凡的。
Currently there isn't one as far as I know. Your example wouldn't work just SimpleTrigger, you would also need a calendar to get rid of firing in the weekend. So in this case CronTrigger would probable be the thing you are looking for.
But back to the original question... There probably isn't any made for Quartz(.NET) and it would quite fast prove itself to be non-trivial.
目前还没有这样的实现,我想在完成后贡献一个 Contrib (或补丁)。我目前正在编写此功能。
Currently there is no such implementation yet, I would like to contribute a Contrib (or a patch) once I am done with it. I am currently writing this feature.