Hi I have a scheduled job to run every hours in Quartz.net:
private static void InitTimers() {
log.Info("InitTimers");
try {
var job = Quartz.JobBuilder.Create<HourlyJob>()
.WithIdentity("HourlyJob")
.Build();
var trigger = Quartz.TriggerBuilder.Create()
.WithIdentity("HourlyTrigger")
.StartAt(Quartz.DateBuilder.EvenHourDateAfterNow())
.WithSchedule(Quartz.SimpleScheduleBuilder.RepeatHourlyForever())
.Build();
_scheduler.ScheduleJob(job, trigger);
} catch (Exception ex) {
log.Error("InitTimers", ex);
}
}
and I am calling it from static class ApplicationServer:
var schedulerFactory = new Quartz.Impl.StdSchedulerFactory();
_scheduler = schedulerFactory.GetScheduler();
_scheduler.Start();
InitTimers();
_scheduler is a static field as well. My server is running on Windows Server 2008 R2 and jobs are always stopping after 8 hours. I've read that it might be because of GC, but in this case I am not really sure what I should do. Any other ideas
Update: So I went through logs and found out that it always stops at 6 pm. What might be the reason that I should look for?