You are here

function rules_scheduler_cron in Rules 7.2

Same name and namespace in other branches
  1. 6 rules_scheduler/rules_scheduler.module \rules_scheduler_cron()

Implements hook_cron().

File

rules_scheduler/rules_scheduler.module, line 13
Rules scheduler module.

Code

function rules_scheduler_cron() {
  if (rules_scheduler_queue_tasks()) {

    // hook_exit() is not invoked for cron runs, so register it as shutdown
    // callback for logging the rules log to the watchdog.
    drupal_register_shutdown_function('rules_exit');

    // Clear the log before running tasks via the queue to avoid logging
    // unrelated logs from previous cron-operations.
    RulesLog::logger()
      ->clear();
  }
}