Quartz.NET trigger not firing

Posted by billy_bob_the on Stack Overflow See other posts from Stack Overflow or by billy_bob_the
Published on 2009-03-25T06:49:16Z Indexed on 2010/03/31 11:53 UTC
Read the original article Hit count: 689

i am using Quartz.NET in my ASP.NET web application. i put the following code in a button click handler to make sure that it executes (for testing purposes):

Quartz.ISchedulerFactory factory = new Quartz.Impl.StdSchedulerFactory();
Quartz.IScheduler scheduler = factory.GetScheduler();
Quartz.JobDetail job = new Quartz.JobDetail("job", null, typeof(BackupJob));
Quartz.Trigger trigger = Quartz.TriggerUtils.MakeDailyTrigger(8, 30); // i edit this each time before compilation (for testing purposes)
trigger.StartTimeUtc = Quartz.TriggerUtils.GetEvenSecondDate(DateTime.UtcNow);
trigger.Name = "trigger";
scheduler.ScheduleJob(job, trigger);
scheduler.Start();

here's "BackupJob":

public class BackupJob : IJob
{
    public BackupJob()
    {
    }

    public void Execute(JobExecutionContext context)
    {
        NSG.BackupJobStart();
    }
}

my question: why is "BackupJobStart()" not firing? i've used similar code before and it worked fine.

EDIT: @Andy White, i would have it in Application_Start in Global.asax. this doesn't work which is why i moved it to a button click handler to narrow down the problem.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about automation