Align .editorconfig files Move Controller logic to DMO classes GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager(); Question EditorConfig Project level editorconfig Format White Spaces AppSetting when EnvironmentVariable not set Corrective Actions Tests Schedule Actions Tests DMO Tests Controller Tests Get ready to use VSCode IDE
28 lines
905 B
C#
28 lines
905 B
C#
using Fab2ApprovalSystem.Workers;
|
|
|
|
using Quartz;
|
|
using Quartz.Impl;
|
|
|
|
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);
|
|
}
|
|
} |