ConfigJob: add configForLatestActivityExists()

This commit is contained in:
Thomas Gelf 2016-06-16 15:51:43 +02:00
parent 734c7c7b02
commit bafc53e7a2

View File

@ -52,9 +52,18 @@ class ConfigJob extends JobHook
protected function shouldGenerate() protected function shouldGenerate()
{ {
return $this->getSetting('force_generate') return $this->getSetting('force_generate') === 'y'
// -> last config?! || ! $this->configForLatestActivityExists();
|| $this->db()->countActivitiesSinceLastDeployedConfig() > 0; }
protected function configForLatestActivityExists()
{
$db = $this->db();
return IcingaConfig::exists(
DirectorDeploymentLog::loadLatest($db)->getConfigHexChecksum(),
$db
);
} }
protected function shouldDeploy(IcingaConfig $config) protected function shouldDeploy(IcingaConfig $config)