Mel Gerats
Mel Gerats

Reputation: 2262

Sitecore scheduled task only runs every hour

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?

Upvotes: 5

Views: 2971

Answers (2)

Paul George
Paul George

Reputation: 1817

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.

Upvotes: 3

Marek Musielak
Marek Musielak

Reputation: 27152

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>

Upvotes: 6

Related Questions