39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System.Web.Http;
|
|
using Fab2ApprovalSystem.Workers;
|
|
using Microsoft.Owin;
|
|
using Owin;
|
|
using Quartz;
|
|
using Quartz.Impl;
|
|
|
|
[assembly: OwinStartupAttribute(typeof(Fab2ApprovalSystem.Startup))]
|
|
namespace Fab2ApprovalSystem
|
|
{
|
|
public partial class Startup
|
|
{
|
|
protected void Application_Start()
|
|
{
|
|
GlobalConfiguration.Configure(WebApiConfig.Register);
|
|
|
|
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
|
|
|
|
IScheduler scheduler = schedulerFactory.GetScheduler().GetAwaiter().GetResult();
|
|
|
|
IJobDetail oooTrainingReportJob = JobBuilder.Create<OOOTrainingReportJob>()
|
|
.WithIdentity("oooTrainingReportJob", "trainingReportGroup")
|
|
.Build();
|
|
|
|
ITrigger oooTrainingReportTrigger = TriggerBuilder.Create()
|
|
.WithIdentity("oooTrainingReportTrigger", "trainingReportGroup")
|
|
.WithCronSchedule("15 13 * * MON")
|
|
.ForJob(oooTrainingReportJob)
|
|
.Build();
|
|
|
|
scheduler.ScheduleJob(oooTrainingReportJob, oooTrainingReportTrigger);
|
|
}
|
|
public void Configuration(IAppBuilder app)
|
|
{
|
|
ConfigureAuth(app);
|
|
}
|
|
}
|
|
}
|