不使用 CRON 字符串的计划设置字符串

发布于 2024-08-16 14:37:33 字数 254 浏览 4 评论 0原文

目前,我们在项目中使用 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 技术交流群。

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

发布评论

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

评论(2

林空鹿饮溪 2024-08-23 14:37:33

据我所知目前还没有。您的示例不仅仅适用于 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.

夜访吸血鬼 2024-08-23 14:37:33

目前还没有这样的实现,我想在完成后贡献一个 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.

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