diff --git a/includes/common.inc b/includes/common.inc index 09764bb24ae..3a016f11a61 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5543,27 +5543,19 @@ function drupal_cron_run() { // Make sure every queue exists. There is no harm in trying to recreate an // existing queue. foreach ($queues as $queue_name => $info) { - if (!$queue_name_previous) { - watchdog('cron', 'Starting execution of queue @queue_name.', array('@queue_name' => $queue_name), WATCHDOG_NOTICE); - } - else { - watchdog('cron', 'Starting execution of queue @queue_name, execution of queue @queue_name_previous took @time.', array( - '@queue_name' => $queue_name, - '@queue_name_previous' => $queue_name_previous, - '@time' => timer_read('cron_queue_' . $queue_name_previous) . 'ms', - ), WATCHDOG_NOTICE); - } + // Log a message saying that the queue started. + watchdog('cron', 'Starting execution of queue @queue_name.', array( + '@queue_name' => $queue_name, + ), WATCHDOG_NOTICE); + timer_start('cron_queue_' . $queue_name); - DrupalQueue::get($queue_name)->createQueue(); - timer_stop('cron_queue_' . $queue_name); - $queue_name_previous = $queue_name; - } - if ($queue_name_previous) { - watchdog('cron', 'Execution of queue @queue_name_previous took @time.', array( - '@queue_name_previous' => $queue_name_previous, - '@time' => timer_read('cron_queue_' . $queue_name_previous) . 'ms', + + // Log a message saying that the queue ended. + watchdog('cron', 'Execution of queue @queue_name took @time.', array( + '@queue_name' => $queue_name, + '@time' => timer_read('cron_queue_' . $queue_name) . 'ms', ), WATCHDOG_NOTICE); } @@ -5571,16 +5563,9 @@ function drupal_cron_run() { // Iterate through the modules calling their cron handlers (if any): foreach (module_implements('cron') as $module) { - if (!$module_previous) { - watchdog('cron', 'Starting execution of @module_cron().', array('@module' => $module), WATCHDOG_NOTICE); - } - else { - watchdog('cron', 'Starting execution of @module_cron(), execution of @module_previous_cron() took @time.', array( - '@module' => $module, - '@module_previous' => $module_previous, - '@time' => timer_read('cron_' . $module_previous) . 'ms', - ), WATCHDOG_NOTICE); - } + // Log a message saying that the cron event started. + watchdog('cron', 'Starting execution of @module_cron().', array('@module' => $module), WATCHDOG_NOTICE); + timer_start('cron_' . $module); // Do not let an exception thrown by one module disturb another. @@ -5592,11 +5577,10 @@ function drupal_cron_run() { } timer_stop('cron_' . $module); - $module_previous = $module; - } - if ($module_previous) { - watchdog('cron', 'Execution of @module_previous_cron() took @time.', array( - '@module_previous' => $module_previous, + + // Log a message saying that the cron event ended. + watchdog('cron', 'Execution of @module_cron() took @time.', array( + '@module' => $module, '@time' => timer_read('cron_' . $module_previous) . 'ms', ), WATCHDOG_NOTICE); }