You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
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<RefreshTokenJob>().Build();
|
|
|
|
|
ITrigger trigger = TriggerBuilder.Create()
|
|
|
|
|
.WithSimpleSchedule(t =>
|
|
|
|
|
t.WithIntervalInMinutes(1)
|
|
|
|
|
.RepeatForever())
|
|
|
|
|
.Build();
|
|
|
|
|
scheduler.ScheduleJob(job, trigger);
|
|
|
|
|
|
|
|
|
|
job = JobBuilder.Create<WechatWorkTokenJob>().Build();
|
|
|
|
|
trigger = TriggerBuilder.Create()
|
|
|
|
|
.WithSimpleSchedule(t =>
|
|
|
|
|
t.WithIntervalInMinutes(1)
|
|
|
|
|
.RepeatForever())
|
|
|
|
|
.Build();
|
|
|
|
|
scheduler.ScheduleJob(job, trigger);
|
|
|
|
|
|
|
|
|
|
job = JobBuilder.Create<DingTalkTokenJob>().Build();
|
|
|
|
|
trigger = TriggerBuilder.Create()
|
|
|
|
|
.WithSimpleSchedule(t =>
|
|
|
|
|
t.WithIntervalInMinutes(1)
|
|
|
|
|
.RepeatForever())
|
|
|
|
|
.Build();
|
|
|
|
|
scheduler.ScheduleJob(job, trigger);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//刷新航信token。
|
|
|
|
|
//20191210 废弃
|
|
|
|
|
//job = JobBuilder.Create<RefreshHangXinTokenJob>().Build();
|
|
|
|
|
//trigger = TriggerBuilder.Create()
|
|
|
|
|
// .WithSimpleSchedule(t =>
|
|
|
|
|
// t.WithIntervalInMinutes(20)
|
|
|
|
|
// .RepeatForever())
|
|
|
|
|
// .Build();
|
|
|
|
|
//scheduler.ScheduleJob(job, trigger);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|