ConfigJob: fix dealing with currently active config

This commit is contained in:
Thomas Gelf 2016-06-17 13:20:15 +02:00
parent a761bb108b
commit 6665d6d80f
2 changed files with 4 additions and 6 deletions

View File

@ -29,6 +29,8 @@ class ConfigJob extends JobHook
if ($this->shouldDeploy($config)) {
$this->deploy($config);
}
$this->clearLastDeployment();
}
protected function api()
@ -83,7 +85,7 @@ class ConfigJob extends JobHook
return false;
}
if ($this->getActiveChecksum() === $config->getChecksum()) {
if ($this->getActiveChecksum() === $config->getHexChecksum()) {
return false;
}
@ -94,7 +96,6 @@ class ConfigJob extends JobHook
protected function deploy(IcingaConfig $config)
{
$this->clearLastDeployment();
$db = $this->db();
$api = $this->api();
$api->wipeInactiveStages($db);

View File

@ -76,10 +76,7 @@ class DirectorDeploymentLog extends DbObject
$db = $connection->getDbAdapter();
$query = $db->select()
->from('director_deployment_log', array('c' => $connection->dbHexFunc('config_checksum')))
->where('stage_name = ?')
->where('stage_collected IS NULL')
->where('startup_succeeded IS NULL')
->order('stage_name');
->where('stage_name = ?');
return $db->fetchOne($query, $stage);
}