コード例 #1
0
		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);
		}
コード例 #2
0
		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);
			
		}