我的生产服务器中有一个 asp.net 网站,现在运行良好。现在我正在使用quartz.net 来执行计划任务,并且在我的开发系统中我已经对其进行了测试。我想将其移至生产服务器。
我的 global.asax 目前在生产服务器中:
void Application_Start(object sender, EventArgs e)
{
Application["Hits"] = 0;
Application["Sessions"] = 0;
Application["TerminatedSessions"] = 0;
ConfigureLogging();
}
我要把它改成
void Application_Start(object sender, EventArgs e)
{
ISchedulerFactory schedFact = new StdSchedulerFactory();
// get a scheduler
IScheduler sched = schedFact.GetScheduler();
sched.Start();
// construct job info
JobDetail jobDetail = new JobDetail("mysSendMailJob", typeof(ScheduledMail));
// fire every day at 06:00
Trigger trigger = TriggerUtils.MakeDailyTrigger(06, 00);
SimpleTrigger trigger2 = new SimpleTrigger("myTrigger",
null,
DateTime.UtcNow,
null,
SimpleTrigger.RepeatIndefinitely,
TimeSpan.FromSeconds(60));
// start on the next even hour
trigger.StartTimeUtc = TriggerUtils.GetEvenHourDate(DateTime.UtcNow);
trigger.Name = "mySendMailTrigger";
// schedule the job for execution
sched.ScheduleJob(jobDetail, trigger2);
// Code that runs on application startup
Application["Hits"] = 0;
Application["Sessions"] = 0;
Application["TerminatedSessions"] = 0;
ConfigureLogging();
}
这些更改会更新还是会发生什么?