.net - Quartz: repeat job always on monday through friday -
i have next trigger:
var resumetaskstrigger = triggerbuilder.create() .withidentity("resumetaskstrigger", "tasks") .startat(datebuilder.futuredate(15, intervalunit.second)) .withschedule( dailytimeintervalschedulebuilder .create() .onmondaythroughfriday()) .build();
should trigger works every week or once? if it's right, can't figure out how set intifinity repeat ischedulebuilder
?
it run forever unless specify end date:
itrigger resumetaskstrigger = triggerbuilder.create() .withidentity("resumetaskstrigger", "tasks") .startat(datebuilder.futuredate(15, intervalunit.second)) .endat(datebuilder.futuredate(10, intervalunit.year)) .withschedule( dailytimeintervalschedulebuilder .create() .onmondaythroughfriday() .withintervalinminutes(30) .startingdailyat(timeofday.hourandminuteofday(10, 0)) .endingdailyat(timeofday.hourandminuteofday(12, 0)) ) .build();
you can use code check schedules defined trigger:
private static void getnextxfiretimes(itrigger trigger, int triggerscount) { console.writeline(string.format("list of next {0} schedules: ", triggerscount.tostring())); var dt = trigger.getnextfiretimeutc(); using (var file = new system.io.streamwriter(@"e:\temp\quartz.net.log.log")) { (int = 0; < triggerscount; i++) { if (dt == null) break; file.writeline(dt.value.tolocaltime().tostring()); dt = trigger.getfiretimeafter(dt); } } }
Comments
Post a Comment