Quartz scheduler not executing job after app pool recycle (.Net)

2.4k Views Asked by At

We have an intranet application hosted on IIS 8.0.

We have some web methods available which needs to be executed at certain time.

So, we have used the Quartz scheduler to schedule the job for executing web methods. In Application_Start event of global.asax, we have written the code to start the scheduler.

To keep the scheduler up and running the Application Pool should be in running mode always, so we have set the property startMode=“AlwaysRunning” and also, application should be started so we have set the application property preloadEnabled=“True”.

We are recycling the application pool at every 1740 minutes (29 Hours, the default time).

Here the question is:

If I have a job scheduled at 3:00 AM in the morning. My app pool is in running state.

I have browsed the application at 6:00 PM on one day before of schedule time.

As per the recycling time my app pool has been recycled at 2:00 AM and till 3:00 AM my application was not pinged but my app pool was in running state.

When Application Pool is recycled, the application pool will be started again (because of the property startMode=“AlwaysRunning”) but the process id if that worker process would be different.

Due to the recycle of app pool quartz had not executed the job as per the schedule. If I browse the application after recycling of app pool, then quartz will execute the job as per the schedule.

Can anyone help me on this at the earliest?

Thanks in anticipation.

1

There are 1 best solutions below

1
On BEST ANSWER

If your IIS 8.0 is running on Sever 2012 OS, you will need to turn on 'Application Initialization' feature.
Please visit this link for more information.
Only after the feature in added, the property 'preloadEnabled=“True"' will be effective.
Please let me know if you are facing this issue on any other OS. Hope this helps.