using DSWeb.Areas.Dispatch.Job; using DSWeb.Areas.MvcShipping.Job; using Quartz; using Quartz.Impl; using System; using System.Collections.Generic; using System.Linq; using System.Web; using DSWeb.Areas.Account.Models.Chfee_Invoice_HangXin; namespace DSWeb { public class JobScheduler { public static void Start() { IScheduler scheduler = StdSchedulerFactory.GetDefaultScheduler(); scheduler.Start(); IJobDetail job = JobBuilder.Create().Build(); ITrigger trigger = TriggerBuilder.Create() .WithSimpleSchedule(t => t.WithIntervalInMinutes(1) .RepeatForever()) .Build(); scheduler.ScheduleJob(job, trigger); job = JobBuilder.Create().Build(); trigger = TriggerBuilder.Create() .WithSimpleSchedule(t => t.WithIntervalInMinutes(1) .RepeatForever()) .Build(); scheduler.ScheduleJob(job, trigger); job = JobBuilder.Create().Build(); trigger = TriggerBuilder.Create() .WithSimpleSchedule(t => t.WithIntervalInMinutes(1) .RepeatForever()) .Build(); scheduler.ScheduleJob(job, trigger); //刷新航信token。 //20191210 废弃 //job = JobBuilder.Create().Build(); //trigger = TriggerBuilder.Create() // .WithSimpleSchedule(t => // t.WithIntervalInMinutes(20) // .RepeatForever()) // .Build(); //scheduler.ScheduleJob(job, trigger); } } }