34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
using Fab2ApprovalSystem.Workers;
|
|
using Quartz.Impl;
|
|
using Quartz;
|
|
|
|
namespace Fab2ApprovalSystem.JobSchedules
|
|
{
|
|
public class OOOTrainingReportJobSchedule
|
|
{
|
|
public static void Start()
|
|
{
|
|
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
|
|
|
IScheduler scheduler = schedulerFactory.GetScheduler().GetAwaiter().GetResult();
|
|
scheduler.Start();
|
|
|
|
IJobDetail oooTrainingReportJob = JobBuilder.Create<OOOTrainingReportJob>()
|
|
.WithIdentity("oooTrainingReportJob", "trainingReportGroup")
|
|
.Build();
|
|
|
|
ITrigger oooTrainingReportTrigger = TriggerBuilder.Create()
|
|
.WithIdentity("oooTrainingReportTrigger", "trainingReportGroup")
|
|
.WithCronSchedule("0 0 12 ? * 2 *")
|
|
.ForJob(oooTrainingReportJob)
|
|
.Build();
|
|
|
|
scheduler.ScheduleJob(oooTrainingReportJob, oooTrainingReportTrigger);
|
|
}
|
|
}
|
|
}
|