[icinga-checkins] icinga.org: icingaweb2-module-director/master: ImportSource: there is no end_time in ImportRun
git at icinga.org
git at icinga.org
Mon Jun 27 09:17:09 CEST 2016
Module: icingaweb2-module-director
Branch: master
Commit: 39cf0a5fb82e47deb52c1ea3fa11ce4a43d553d5
URL: https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=39cf0a5fb82e47deb52c1ea3fa11ce4a43d553d5
Author: Thomas Gelf <thomas at gelf.net>
Date: Fri Jun 24 17:01:47 2016 +0200
ImportSource: there is no end_time in ImportRun
---
library/Director/Objects/ImportSource.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/library/Director/Objects/ImportSource.php b/library/Director/Objects/ImportSource.php
index 43050f5..41d03ff 100644
--- a/library/Director/Objects/ImportSource.php
+++ b/library/Director/Objects/ImportSource.php
@@ -29,7 +29,7 @@ class ImportSource extends DbObjectWithSettings
protected $settingsRemoteId = 'source_id';
- public function fetchLatestRun()
+ public function fetchLastRun()
{
return $this->fetchLastRunBefore(time());
}
@@ -49,14 +49,14 @@ class ImportSource extends DbObjectWithSettings
array('ir' => 'import_run'),
'ir.id'
)->where('ir.source_id = ?', $this->id)
- ->where('ir.end_time < ?', date('Y-m-d H:i:s', $timestamp))
- ->order('ir.end_time DESC')
+ ->where('ir.start_time < ?', date('Y-m-d H:i:s', $timestamp))
+ ->order('ir.start_time DESC')
->limit(1);
$runId = $db->fetchOne($query);
if ($runId) {
- return ImportRun::fromDb($this->connection);
+ return ImportRun::load($runId, $this->getConnection());
} else {
return null;
}
More information about the icinga-checkins
mailing list