From 5ec66a527c4c1eb035eab23bcc1c3d2851a49aa1 Mon Sep 17 00:00:00 2001
From: Alex Barth <alex_b@53995.no-reply.drupal.org>
Date: Sun, 1 Nov 2009 00:18:03 +0000
Subject: [PATCH] Take actual start time for calculating elapsed time. Don't
 log to watchdog when starting cron run.

---
 includes/FeedsScheduler.inc | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/includes/FeedsScheduler.inc b/includes/FeedsScheduler.inc
index bc3ffa8e..cf1a7899 100644
--- a/includes/FeedsScheduler.inc
+++ b/includes/FeedsScheduler.inc
@@ -96,17 +96,12 @@ class FeedsScheduler implements IFeedsScheduler {
    */
   public function cron() {
 
-    // Logging and timeout tracking.
-    if ($this->time() == FEEDS_REQUEST_TIME) {
-      watchdog('FeedsScheduler', 'Start processing');
-    }
-    else {
-      watchdog('FeedsScheduler', 'Start - !date (debug time !time)', array('!date' => format_date($this->time()), '!time' => $this->time()));
-    }
+    // Check and set scheduler semaphore, take time.
     if (variable_get('feeds_scheduler_cron', FALSE)) {
       watchdog('FeedsScheduler', 'Last cron process did not finish.', array(), WATCHDOG_ERROR);
     }
     variable_set('feeds_scheduler_cron', TRUE);
+    $start = time();
 
     // Get feeds configuration, check whether drupal_queue is present and set
     // parameters accordingly.
@@ -157,7 +152,7 @@ class FeedsScheduler implements IFeedsScheduler {
 
     // Unflag and post a message that we're done.
     variable_set('feeds_scheduler_cron', FALSE);
-    watchdog('FeedsScheduler', 'Finished processing schedule after !time.', array('!time' => format_interval(time() - $this->time())));
+    watchdog('FeedsScheduler', 'Finished processing schedule after !time.', array('!time' => format_interval(time() - $start)));
   }
 
   /**
-- 
GitLab