C#-当站点上没有活动时,Quartz Scheduler停止运行 [英] C# - Quartz scheduler stopped running when no activity on the site

查看:61
本文介绍了C#-当站点上没有活动时,Quartz Scheduler停止运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用石英调度程序创建了asp.net网站.该作业在后台运行,该网站上没有其他活动.

I have created asp.net site with quartz scheduler. The job is running in background and there is no other activity on the site.

Quartz Scheduler每30分钟安排一次.

Quartz scheduler scheduled for every 30 minutes.

IIS启动后,Scheduler运行正常.

After IIS started, Scheduler is running correctly.

但是一段时间后,Scheduler停止运行(大约1个小时).

But after some time, Scheduler stopped running (about 1 hour).

如果用户登录或查看仪表板时在网站上进行一项或多项活动,则Scheduler可以正确运行.

If have one or more activity on site as user login or view dashboard then Scheduler runs correctly.

但是当网站上没有任何活动时,它将停止运行.

But when have no activity on site it stops running.

在网站上没有任何活动时,如何始终保持我的Scheduler正常运行?

How to keep alive my Scheduler for all the times when no activity on site?

P/s:我知道我的问题可以与其他问题重复.但是我仍然问,因为我无法评论其他问题的答案.

P/s: I know my question can be duplicate with other question. But i still ask because i can not comment to ask in answers of other question.

Day Running at: 7/14/2016 4:00:00 AM
--
Day Running at: 7/14/2016 4:30:00 AM
--
Day Running at: 7/14/2016 5:00:00 AM
--
Stopped running
--
Day Running at: 7/14/2016 2:00:00 PM
--
Day Running at: 7/14/2016 2:30:00 PM
--
Day Running at: 7/14/2016 3:00:00 PM
--
Stopped running
--

推荐答案

默认情况下,如果应用程序在一段时间内未收到任何请求,则IIS将卸载您的应用程序.

By default, IIS will unload your application if the application receives no requests for a period of time.

您可以将IIS配置为永不卸载您的应用程序.IIS有许多原因可以卸载您的应用程序-确保禁用所有它们.它是在应用程序池设置中,最好转到高级设置",然后仔细进行所有设置.

You can configure IIS to never unload your application.There are plenty of reasons IIS will unload your application - make sure you disable all of them. It is in the application pool settings, better go to Advanced Settings and pass carefully through all of them.

另一方面,如果您有后台作业,则需要按计划可靠地运行,为什么除了Web应用程序之外,又不将其部署在Windows服务中?Web应用程序最适合处理传入的请求,而不是运行计划的作业.

On a side note, if you have a background job you need to reliably run on schedule, why not deploy it in a Windows service, in addition to the web application? Web applications are best at serving incoming requests, not running scheduled jobs.

更新

在应用程序池的高级设置"中查看以下内容:

Check out these in Advanced Settings of your application pool:

  • 流程模型/空闲超时和空闲超时操作
  • 回收/定期时间间隔,请求限制,私有内存限制,虚拟内存限制

这篇关于C#-当站点上没有活动时,Quartz Scheduler停止运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆