ConfigJob: add configForLatestActivityExists()
This commit is contained in:
parent
734c7c7b02
commit
bafc53e7a2
|
@ -52,9 +52,18 @@ class ConfigJob extends JobHook
|
|||
|
||||
protected function shouldGenerate()
|
||||
{
|
||||
return $this->getSetting('force_generate')
|
||||
// -> last config?!
|
||||
|| $this->db()->countActivitiesSinceLastDeployedConfig() > 0;
|
||||
return $this->getSetting('force_generate') === 'y'
|
||||
|| ! $this->configForLatestActivityExists();
|
||||
}
|
||||
|
||||
protected function configForLatestActivityExists()
|
||||
{
|
||||
$db = $this->db();
|
||||
|
||||
return IcingaConfig::exists(
|
||||
DirectorDeploymentLog::loadLatest($db)->getConfigHexChecksum(),
|
||||
$db
|
||||
);
|
||||
}
|
||||
|
||||
protected function shouldDeploy(IcingaConfig $config)
|
||||
|
|
Loading…
Reference in New Issue