Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# IIS 7上的Quartz计划程序自动停止_C#_.net_Scheduled Tasks_Quartz.net - Fatal编程技术网

C# IIS 7上的Quartz计划程序自动停止

C# IIS 7上的Quartz计划程序自动停止,c#,.net,scheduled-tasks,quartz.net,C#,.net,Scheduled Tasks,Quartz.net,我使用Quartz.Net库来安排任务 它对我来说工作正常。但是当我在生产服务器IIS 7上运行时。最初它工作正常,但3-4小时后它会自动停止。我必须重新启动调度程序。 问题是什么 没有生成任何异常。因为我正在将异常记录到日志文件中。但是没有关于调度程序错误的任何书面说明 ISchedulerFactory schedFact = new StdSchedulerFactory(); // get a scheduler IScheduler sched = schedFact

我使用Quartz.Net库来安排任务

它对我来说工作正常。但是当我在生产服务器IIS 7上运行时。最初它工作正常,但3-4小时后它会自动停止。我必须重新启动调度程序。 问题是什么

没有生成任何异常。因为我正在将异常记录到日志文件中。但是没有关于调度程序错误的任何书面说明

ISchedulerFactory schedFact = new StdSchedulerFactory();

    // get a scheduler
    IScheduler sched = schedFact.GetScheduler();

    sched.Start();


    JobDetail jobDetail = new JobDetail("myJob", null, typeof(DumbJob));

    DateTime dt = DateTime.Now;
    dt = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(dt, TimeZoneInfo.Local.Id, "India Standard Time");

    SimpleTrigger trigger2 = new SimpleTrigger("myTrigger",
                            null,
                            DateTime.UtcNow,
                            null,
                            SimpleTrigger.RepeatIndefinitely,
                            TimeSpan.FromSeconds(60)); 

    sched.ScheduleJob(jobDetail, trigger2);

我猜这一切都是关于应用程序池回收。。。 (IIS会在若干请求或特定时间过后自动回收应用程序池)


更多信息:

请检查Quartz调度程序的线程数。 在web配置中,您可以如下定义线程数

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <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="ServerScheduler" />
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="10" />
    <add key="quartz.threadPool.threadPriority" value="2" />
    <add key="quartz.jobStore.misfireThreshold" value="60000" />
    <add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
  </quartz>
</configuration>

我希望这对你有帮助