Skip to content
Snippets Groups Projects
Commit 5ec66a52 authored by Alex Barth's avatar Alex Barth
Browse files

Take actual start time for calculating elapsed time.

Don't log to watchdog when starting cron run.
parent 78df7b6d
No related branches found
No related tags found
No related merge requests found
...@@ -96,17 +96,12 @@ class FeedsScheduler implements IFeedsScheduler { ...@@ -96,17 +96,12 @@ class FeedsScheduler implements IFeedsScheduler {
*/ */
public function cron() { public function cron() {
// Logging and timeout tracking. // Check and set scheduler semaphore, take time.
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()));
}
if (variable_get('feeds_scheduler_cron', FALSE)) { if (variable_get('feeds_scheduler_cron', FALSE)) {
watchdog('FeedsScheduler', 'Last cron process did not finish.', array(), WATCHDOG_ERROR); watchdog('FeedsScheduler', 'Last cron process did not finish.', array(), WATCHDOG_ERROR);
} }
variable_set('feeds_scheduler_cron', TRUE); variable_set('feeds_scheduler_cron', TRUE);
$start = time();
// Get feeds configuration, check whether drupal_queue is present and set // Get feeds configuration, check whether drupal_queue is present and set
// parameters accordingly. // parameters accordingly.
...@@ -157,7 +152,7 @@ class FeedsScheduler implements IFeedsScheduler { ...@@ -157,7 +152,7 @@ class FeedsScheduler implements IFeedsScheduler {
// Unflag and post a message that we're done. // Unflag and post a message that we're done.
variable_set('feeds_scheduler_cron', FALSE); 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)));
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment