Sitecore scheduled task only runs every hour
Asked Answered
W

2

5

We set up a schedule to execute a command. It is scheduled to run every 5 minutes as follows: 20090201T235900|20190201T235900|127|00:05:00

However, from the logs we see it runs only every hour.

Is there a reason for this?

Whale answered 9/5, 2012 at 12:39 Comment(4)
can you remind me of the meaning of the elements of this string - not used Sitecore in a while.Mascagni
afaik, from|until|somthing|intervalWhale
What is the something I wonder - might be important.Mascagni
of course, had to wait a bit before I couldWhale
K
6

check scheduling frequency in your sitecore.config file

<sitecore>
    <scheduling>
        <!-- Time between checking for scheduled tasks waiting to execute -->
        <frequency>00:05:00</frequency>
    </scheduling>
</sitecore>
Kanazawa answered 9/5, 2012 at 12:49 Comment(3)
hmm, now ALL schedules are running every 5 minutesWhale
Are you sure they do really 'run' or they are just checked by the scheduler whether they should run or not? If yes, what are the schedule details for other scheduled jobs?Kanazawa
If they do run every 5 minutes you have to check the expression in the Job trigger.Sklar
E
3

The scheduling interval is based on the the scheduler interval and the job interval. Every scheduler interval period, all the configured jobs are evaluated. This is logged. During that evaluation, each job checked against the last time it ran, if that interval is greater that the configured job interval, the job is started.

It's fairly simple, but it's important to understand the mechanism. You can also see how it allows no way of inherently running jobs at a specific time, only at approximate intervals.

You can also see that jobs can never run more frequently than the scheduler interval regardless of the job interval. It is not unreasonable to set the scheduler to one-minute intervals to reduce the inaccuracy of job timings to no more than a minute.

In a worse case, with a 5 minute sheduler interval and a 5 minute job interval. The delay to job starting could be up to 9 minutes 59 seconds.

Enlightenment answered 10/5, 2012 at 9:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.