public static void Start() { var scheduler = StdSchedulerFactory.GetDefaultScheduler(); scheduler.Start(); { var job = JobBuilder.Create <MasterJob>().Build(); var trigger = TriggerBuilder.Create() .StartNow() .WithDailyTimeIntervalSchedule(s => s.WithIntervalInHours(24) .OnEveryDay() .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(0, 0))) .Build(); scheduler.ScheduleJob(job, trigger); } { var job = JobBuilder.Create <RemindJob>().Build(); var trigger = TriggerBuilder.Create() .WithDailyTimeIntervalSchedule(x => x.OnEveryDay() .WithIntervalInHours(8) .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(5, 30))) .Build(); scheduler.ScheduleJob(job, trigger); } var testJob = new MasterJob(); testJob.Execute(null); var assignJob = new AssignShiftJob(); assignJob.Execute(null); }
public static void Start() { var scheduler = StdSchedulerFactory.GetDefaultScheduler(); scheduler.Start(); { var job = JobBuilder.Create<MasterJob>().Build(); var trigger = TriggerBuilder.Create() .StartNow() .WithDailyTimeIntervalSchedule(s => s.WithIntervalInHours(24) .OnEveryDay() .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(0, 0))) .Build(); scheduler.ScheduleJob(job, trigger); } { var job = JobBuilder.Create<RemindJob>().Build(); var trigger = TriggerBuilder.Create() .WithDailyTimeIntervalSchedule(x => x.OnEveryDay() .WithIntervalInHours(8) .StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(5, 30))) .Build(); scheduler.ScheduleJob(job, trigger); } var testJob = new MasterJob(); testJob.Execute(null); var assignJob = new AssignShiftJob(); assignJob.Execute(null); }