public override void AddJob(Job job) { JobNames.Add(job.Name); ISchedulerFactory schedulerFactory = new StdSchedulerFactory(Common.Properties.QuartzSchedulerProperties); IScheduler scheduler = schedulerFactory.GetScheduler(); JobDetail jobDetail = new JobDetail(job.Name, "sequential", job.GetType(), false, true, true); jobDetail.JobDataMap = job.JobDataMap; scheduler.AddJob(jobDetail, true); }
public override void Execute(Job job) { Instances.MainCounterStore.Increment(new Caching.CacheKey(Caching.CacheKeyPrefix.JobQueued, Timeslots.GetCurrentTimeslot().StartTime.ToString()), () => 0); JobDetail jobDetail = new JobDetail(job.Name, "immediate", job.GetType()); jobDetail.JobDataMap = job.JobDataMap; SimpleTrigger trigger = new SimpleTrigger("Trigger" + job.Name, "immediate"); ISchedulerFactory schedulerFactory = new StdSchedulerFactory(Common.Properties.QuartzSchedulerProperties); IScheduler scheduler = schedulerFactory.GetScheduler(); scheduler.ScheduleJob(jobDetail, trigger); }