简体   繁体   English

Quartz.net Scheduler进入待机状态

[英]Quartz.net scheduler going to standby

I'm using quartz .net server embedded in my asp.net application but is always turning into standby mode. 我正在使用嵌入在我的asp.net应用程序中的石英.net服务器,但始终会进入待机模式。 Even with a scheduled cron job in NORMAL mode. 即使在正常模式下执行计划的cron作业。

Those are my scheduler properties: 这些是我的调度程序属性:

var properties = new NameValueCollection();

        properties["quartz.dataSource.DataSource.connectionString"] = "data source=connectionstring";
        properties["quartz.dataSource.DataSource.provider"] = "SqlServer-20";

        properties["quartz.scheduler.instanceName"] = "MyScheduler";

        properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
        properties["quartz.threadPool.threadCount"] = "5";
        properties["quartz.threadPool.threadPriority"] = "Normal";

        properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz";
        properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz ";
        properties["quartz.jobStore.tablePrefix"] = "QRTZ_";
        properties["quartz.jobStore.dataSource"] = "DataSource";
        properties["quartz.jobStore.useProperties"] = "true";

        return new StdSchedulerFactory(properties);

How to make it always running? 如何使其始终运行? Do I need to run it as a windows service? 我需要将其作为Windows服务运行吗?

Running the Quartz.net scheduler as a windows service seems to be best method. 将Quartz.net调度程序作为Windows服务运行似乎是最好的方法。

The default for IIS is to shutdown any ASP.net applications if there are no users connected to them, which means your scheduler is no longer running. IIS的默认设置是在没有用户连接时关闭任何ASP.net应用程序,这意味着您的调度程序不再运行。 It is possible to change these defaults (see Can you prevent your ASP.NET application from shutting down? ), but a better way is to write your scheduler as a windows service. 可以更改这些默认值(请参阅可以阻止ASP.NET应用程序关闭吗? ),但是更好的方法是将调度程序编写为Windows服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM