mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
ImportSource: there is no end_time in ImportRun
This commit is contained in:
parent
20197e1c9c
commit
39cf0a5fb8
@ -29,7 +29,7 @@ class ImportSource extends DbObjectWithSettings
|
|||||||
|
|
||||||
protected $settingsRemoteId = 'source_id';
|
protected $settingsRemoteId = 'source_id';
|
||||||
|
|
||||||
public function fetchLatestRun()
|
public function fetchLastRun()
|
||||||
{
|
{
|
||||||
return $this->fetchLastRunBefore(time());
|
return $this->fetchLastRunBefore(time());
|
||||||
}
|
}
|
||||||
@ -49,14 +49,14 @@ class ImportSource extends DbObjectWithSettings
|
|||||||
array('ir' => 'import_run'),
|
array('ir' => 'import_run'),
|
||||||
'ir.id'
|
'ir.id'
|
||||||
)->where('ir.source_id = ?', $this->id)
|
)->where('ir.source_id = ?', $this->id)
|
||||||
->where('ir.end_time < ?', date('Y-m-d H:i:s', $timestamp))
|
->where('ir.start_time < ?', date('Y-m-d H:i:s', $timestamp))
|
||||||
->order('ir.end_time DESC')
|
->order('ir.start_time DESC')
|
||||||
->limit(1);
|
->limit(1);
|
||||||
|
|
||||||
$runId = $db->fetchOne($query);
|
$runId = $db->fetchOne($query);
|
||||||
|
|
||||||
if ($runId) {
|
if ($runId) {
|
||||||
return ImportRun::fromDb($this->connection);
|
return ImportRun::load($runId, $this->getConnection());
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user