c#quartz.net并不总是触发
我有一份工作,每30分钟触发一次。我已经设置了测试表并记录了工作启动时的信息。例如:c#quartz.net并不总是触发,c#,quartz-scheduler,C#,Quartz Scheduler,我有一份工作,每30分钟触发一次。我已经设置了测试表并记录了工作启动时的信息。例如: 2015-11-14 03:00:00.000 2015-11-14 03:30:00.000 2015-11-14 04:00:00.000 2015-11-14 04:30:00.000 2015-11-14 05:00:00.000 2015-11-14 05:30:00.000 2015-11-14 06:00:00.003 2015-11-14 06:30:00.000 但这已经是我第二次提醒你停
2015-11-14 03:00:00.000
2015-11-14 03:30:00.000
2015-11-14 04:00:00.000
2015-11-14 04:30:00.000
2015-11-14 05:00:00.000
2015-11-14 05:30:00.000
2015-11-14 06:00:00.003
2015-11-14 06:30:00.000
但这已经是我第二次提醒你停止工作,不要解雇。已经是下午12点了,最后一份工作是在06:30:00被解雇的。解决方案是再次发布应用程序,并覆盖旧bin。。。为什么会发生这种情况,是石英虫还是服务器?另外,我正在使用asp.net mvc,代码如下:
ITrigger trigger = TriggerBuilder.Create()
.WithDailyTimeIntervalSchedule
(s =>
s.WithIntervalInMinutes(30)
.OnEveryDay()
.StartingDailyAt(TimeOfDay.HourAndMinuteOfDay(0, 0))
)
.Build();
scheduler.ScheduleJob(job, trigger);
此外,当作业未被触发时,服务器未关闭 问题在于,当服务器未处于活动状态(未接收请求),服务器正在汇集web应用程序的资源时,您需要设置服务器: 或者让你的网站一直做一些事情来避免共享,我做了一项每两分钟运行一次的工作,它加载一个只有一个短文本的页面,下面是我的代码:
WebClient webClient = new WebClient();
var stream = webClient.OpenRead("http://example.com/");
var client = new WebClient();
var text = client.DownloadString("http://example.com/");
WebRequest request = WebRequest.Create("http://http://example.com/");
//Get the response
WebResponse response = request.GetResponse();
//Read the stream from the response
StreamReader reader = new StreamReader(response.GetResponseStream());
问题在于,当服务器未处于活动状态(未接收请求),服务器正在汇集您的web应用程序的资源时,您需要设置服务器: 或者让你的网站一直做一些事情来避免共享,我做了一项每两分钟运行一次的工作,它加载一个只有一个短文本的页面,下面是我的代码:
WebClient webClient = new WebClient();
var stream = webClient.OpenRead("http://example.com/");
var client = new WebClient();
var text = client.DownloadString("http://example.com/");
WebRequest request = WebRequest.Create("http://http://example.com/");
//Get the response
WebResponse response = request.GetResponse();
//Read the stream from the response
StreamReader reader = new StreamReader(response.GetResponseStream());