Creating OOOTrainingReport scheduled job
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user