mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
ConfigJob: fix dealing with currently active config
This commit is contained in:
parent
a761bb108b
commit
6665d6d80f
@ -29,6 +29,8 @@ class ConfigJob extends JobHook
|
|||||||
if ($this->shouldDeploy($config)) {
|
if ($this->shouldDeploy($config)) {
|
||||||
$this->deploy($config);
|
$this->deploy($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->clearLastDeployment();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function api()
|
protected function api()
|
||||||
@ -83,7 +85,7 @@ class ConfigJob extends JobHook
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->getActiveChecksum() === $config->getChecksum()) {
|
if ($this->getActiveChecksum() === $config->getHexChecksum()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +96,6 @@ class ConfigJob extends JobHook
|
|||||||
|
|
||||||
protected function deploy(IcingaConfig $config)
|
protected function deploy(IcingaConfig $config)
|
||||||
{
|
{
|
||||||
$this->clearLastDeployment();
|
|
||||||
$db = $this->db();
|
$db = $this->db();
|
||||||
$api = $this->api();
|
$api = $this->api();
|
||||||
$api->wipeInactiveStages($db);
|
$api->wipeInactiveStages($db);
|
||||||
|
@ -76,10 +76,7 @@ class DirectorDeploymentLog extends DbObject
|
|||||||
$db = $connection->getDbAdapter();
|
$db = $connection->getDbAdapter();
|
||||||
$query = $db->select()
|
$query = $db->select()
|
||||||
->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum')))
|
->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum')))
|
||||||
->where('stage_name = ?')
|
->where('stage_name = ?');
|
||||||
->where('stage_collected IS NULL')
|
|
||||||
->where('startup_succeeded IS NULL')
|
|
||||||
->order('stage_name');
|
|
||||||
|
|
||||||
return $db->fetchOne($query, $stage);
|
return $db->fetchOne($query, $stage);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user