On this page
Core compatibility
This is documentation for Drupal 7, which is no longer supported. Learn more and find resources for Drupal 7 sites
Ultimate Cron hooks into drupal_cron_run(), so this function is entirely safe to run at any time, including from simpletests where Ultimate Cron is enabled.
There are a couple of howevers ... however:
1.) All hook_cron() will be run regardless of their schedule.
2.) Ultimate Cron will lock all hook_cron() jobs so that drupal_cron_run() can run safely.
3.) If just one of these jobs cannot get a lock, an exception will be thrown.
4.) All other cron jobs (e.g. from hook_cronapi() or hook_cron_alter()), will also run regardless of their schedule. This behaviour can be changed by setting the variable ultimate_cron_check_schedule_on_core_cron to TRUE.
5.) Even though calling drupal_core_run() is safe, it is not expected to be called from anywhere else than cron.php, and will therefore log a watchdog message with the type WATCHDOG_CRITICAL.
Processing cron like core does
If you want to retain the way Drupal core processes cron, yet get an overview of exactly when each job was run, how long it took and get an error log for each job, you can easily emulate the core cron processing interval by:
- Set scheduler to crontab with the rule */3 * * * * (for a 3 hour interval).
- Set the catch up to something very high, e.g. 31536000 (a year).
If all the jobs are using defaults (which they are unless they have been changed not to), you can just set the default scheduler, rule and catch up.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion