I have a web application and i want to implement scheduler I am using Quartez.Net library
I added the following code to the application in Global.asax
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
MyScheduler.StartScheduler();
}
I Created the following class to start my job periodically
public class MyScheduler
{
public void StartScheduler()
{
// First we must get a reference to a scheduler
ISchedulerFactory sf = new StdSchedulerFactory();
IScheduler sched = sf.GetScheduler();
// computer a time that is on the next round minute
DateTimeOffset runTime = DateBuilder.EvenMinuteDate(DateTimeOffset.UtcNow);
// define the job and tie it to our HelloJob class
IJobDetail job = JobBuilder.Create<MyJob>()
.WithIdentity("job1", "group1")
.Build();
ITrigger trigger = TriggerBuilder.Create()
.WithIdentity("trigger1", "group1")
.WithDailyTimeIntervalSchedule(
x => x.StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(14, 41))
.EndingDailyAt(TimeOfDay.HourAndMinuteOfDay(14,43))
.WithIntervalInSeconds(30))
.Build();
// Tell quartz to schedule the job using our trigger
sched.ScheduleJob(job, trigger);
// Start up the scheduler (nothing can actually run until the
// scheduler has been started)
sched.Start();
}
}
I want to know is there is any problem if i leave that scheduler running without stopping it