General developer forum

Cron Jobs vs Scheduled Tasks

 
Picture of Justin Hunt
Re: Cron Jobs vs Scheduled Tasks
Particularly helpful MoodlersPlugin developers

The Moodle cron job and scheduled tasks are closely related. When Moodle's cron job runs, it looks up the scheduled tasks and runs the ones that are due.

There is another thing which confuses this, because plugins can also specify their own task to be run on cron in their version.php file. I don't know what the name for this is, but lets say its the "Cron task." This is really a legacy thing and we should be using scheduled tasks now. This cron task thing could not be controlled by admin and would get called on each cron running. Now we can run Moodle's cron job each minute, and rather then hundred of tasks get called, just the scheduled ones due and adhoc tasks should run. 

So if you look at your Moodle cron output and see lots of scheduled tasks and adhoc tasks logging actions there, all is good. Thats how it is supposed to be. 

 
Average of ratings: Useful (2)