I have an ASP.NET website, and I am using Quartz to do some background work. The Quartz job is set to trigger every 5 minutes.
Will Quartz:
If the answer is #2, is there a way to have the job run all the time?
At some point, after some time of inactivity, your IIS hosted application will fall in some king of 'sleep mode'. From this moment, your trigger won't launch jobs anymore, until your app get reactivated by a user trying to access to it.
Here are some solution available to you :
Run your job in a separated windows service. Need some refactoring job but clearly the safest solution
Hangfire is a another .Net background job library. Here's a link they provide to their users to fix this problem, by Making ASP.NET application always running. Note that you need to have full control of your hosting environment to achieve this.
You could set some service as Pingdom to to prevent your site from faling into this 'sleep mode'. However, I would not recommand this solution.
Note that the time needed before your app fall into 'sleep mode' can change from an environment to another. If in your case It need more than 5 minutes (the time between each of your jobs), this process could be enough to keep your web site up. In fact, it would act as the solution #3 (use an external service to poke your environment at a frequent rate)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With