我弄清楚要走的路可能是使用Cron Expressions,但到目前为止,我还没有运气“Recur Every X Weeks”
谢谢!
4 回答
7
正在运行Quartz.Net 2.0和选项吗?它尚未正式发布,但在其中有一种新的触发类型可以解决您的问题 . 它's called the calendar interval trigger. Basically you define it just as you described in your question. You set the interval to 2 and the interval unit to weeks, and it fires every 2 weeks. I'写了一篇描述它的帖子here . 您可以访问源代码文档here .
4 回答
正在运行Quartz.Net 2.0和选项吗?它尚未正式发布,但在其中有一种新的触发类型可以解决您的问题 . 它's called the calendar interval trigger. Basically you define it just as you described in your question. You set the interval to 2 and the interval unit to weeks, and it fires every 2 weeks. I'写了一篇描述它的帖子here . 您可以访问源代码文档here .
这是我用过的解决方案......
当没有复发时,我使用cron触发器并选择日期并使其每周运行
例如 . 0 0 * * 1,2,3
当每个选定的日子都有一次复发时,我会添加一个SimpleTrigger,低音开始日期是星期几,然后我通过乘以7的复发来计算复发
所以我每天最终都会有一个简单的触发器 .
我希望这有助于其他人!
它是一个Complext触发器,您可以通过3个触发器进行管理;
触发2周样本cron:"0 0 0 1 *"
触发2周样本cron:"0 0 0 15 *"
触发trig选择天样本cron:"0 0 0 ? * SUN-SAT"
第一个触发器将创建3.第二个触发器将删除3 .
祝好运 .
不幸的是,Quartz.Net 2未发布,未记录,并引入了重大变化 .
就像Aureliano和Bongo所说,触发器的组合可能有所帮助,但我不太了解他们各自的解决方案 .
我的解决方案是包装CronTrigger并跳过不需要的事件: