Configure a CronString for a BiWeekly job in Quartz.Net

后端 未结 2 1576
北海茫月
北海茫月 2021-01-21 15:48

How can I configure a CronString for Quartz.Net job scheduler for the following job:

Job should run on BiWeekly on Monday at 12:00 AM. i.e. it should run on every Monday

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 16:20

    Actually what you might be looking for is CalenderIntervalTrigger, which is capable to do this easily.

    var trigger = TriggerBuilder.Create()
        .StartAt(new DateTime(2012, 11, 19, 12, 0, 0).ToUniversalTime())
        .WithCalendarIntervalSchedule(x => x.WithIntervalInWeeks(2))
        .Build();
    

提交回复
热议问题