Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Scheduled Jobs: Do not run at scheduled time.


We have two scheduled jobs.  One is scheduled to run at 7:00 AM the other at 7:30 AM.  The first day they run at the times they were scheduled to run.  After that they run at different times.  For example; one job, scheduled for 7:00 AM ran at 9:15 AM and the next day at 4:40 PM.

We have IIS Application Initialization installed on the IIS Server.  Can anyone explain why this is happening?

Thanks for your assistance.

Sep 25, 2017 18:28

how do you set scheduling time to execute specificly at 7:00 AM? how long it takes for the job to execute?

Sep 26, 2017 22:26

Scheduled tasks are set to run at an interval, e.g. one time every day. When the job has finished it updates "next run" with the interval. That means that if the job starts at 7:00 and ends at 7:02, next run will be sheduled at 7:02 the next day, next day after that 7:04, and so on.
I think that sheduled jobs also depends on the site getting traffic. If there is no traffic, the scheduled job won't run at the scheduled time. But once there is traffic, scheduled jobs that are "late" will run (and after that the interval will be used to set next run). 

Sep 27, 2017 11:10

"I think that sheduled jobs also depends on the site getting traffic" - can you show the code where this is decided?

Sep 27, 2017 11:43

Nope, but now I took a look in the docs :-)

Because scheduled jobs are executed in the same process as the site, the site's web server must be up and running. To ensure this, use the IIS feature "Application Initialization," or have a site supervisor periodically ping the site. In Azure Web Apps enable "Always On"

I interpret that to: either have traffic or use other means to stop site from going to sleep.

Sep 27, 2017 14:08
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.