我有quartz.net集成在asp.net mvc应用程序中。quartz.net发射两次
我有计划在凌晨每天运行一次。 大部分的时间,我的样本作业火灾2倍
2011-06-06 04:00:00.0077|INFO| -> once
2011-06-06 04:00:00.0233|INFO| -> twice
但它已经发生了,它触发只有一次,但很少(只有一次实际)。
我很想弄清楚为什么发生这种情况,或者也可以建议有关如何解决此事件(它发生在托管环境中)
这些结合点:
全球.Asax.cs
protected void Application_Start()
{
ISchedulerFactory factory = new StdSchedulerFactory()
IScheduler scheduler = factory.GetScheduler();
scheduler.Start();
}
的web.config
<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<quartz>
<add key="quartz.scheduler.instanceName" value="JobScheduler" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<add key="quartz.jobStore.misfireThreshold" value="60000" />
<add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
<add key="quartz.plugin.xml.type" value="Quartz.Plugin.Xml.JobInitializationPlugin, Quartz" />
<add key="quartz.plugin.xml.fileNames" value="~/jobs.config" />
</quartz>
jobs.config
<quartz xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" overwrite-existing-jobs="true">
<job>
<job-detail>
<name>SampleJob</name>
<group>SampleJobs</group>
<description>sample</description>
<job-type>Services.SampleJob, Sample</job-type>
<volatile>false</volatile>
<durable>true</durable>
<recover>false</recover>
</job-detail>
<trigger>
<cron>
<name>SampleJobTrigger</name>
<group>SampleJobs</group>
<description>Description</description>
<job-name>SampleJob</job-name>
<job-group>SampleJobs</job-group>
<cron-expression>0 0 4 * * ? *</cron-expression>
</cron>
</trigger>
</job>
</quartz>
任何帮助或指针大大appriciated
--MB
什么是获取属性? – Demodave 2016-03-02 14:37:51
顺便说一句,这是一个很好的解决方案? – Worthy7 2017-07-14 08:18:27
@ Worthy7:我猜是因为它被接受了。 – LeftyX 2017-07-14 11:52:23