mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
Sync: try to get deferred group membership...
...resolver straight fixes #1038
This commit is contained in:
parent
a89d6aa548
commit
07834361d0
@ -184,7 +184,7 @@ class Sync
|
|||||||
*/
|
*/
|
||||||
protected function fetchSyncProperties()
|
protected function fetchSyncProperties()
|
||||||
{
|
{
|
||||||
$this->syncProperties = $this->rule->fetchSyncProperties();
|
$this->syncProperties = $this->rule->getSyncProperties();
|
||||||
foreach ($this->syncProperties as $key => $prop) {
|
foreach ($this->syncProperties as $key => $prop) {
|
||||||
if ($prop->destination_field === 'vars' && $prop->merge_policy === 'override') {
|
if ($prop->destination_field === 'vars' && $prop->merge_policy === 'override') {
|
||||||
$this->replaceVars = true;
|
$this->replaceVars = true;
|
||||||
@ -502,7 +502,7 @@ class Sync
|
|||||||
protected function deferResolvers()
|
protected function deferResolvers()
|
||||||
{
|
{
|
||||||
if (in_array($this->rule->get('object_type'), array('host', 'hostgroup'))) {
|
if (in_array($this->rule->get('object_type'), array('host', 'hostgroup'))) {
|
||||||
$resolver = new HostGroupMembershipResolver($this->db);
|
$resolver = $this->getHostGroupMembershipResolver();
|
||||||
$resolver->defer()->setUseTransactions(false);
|
$resolver->defer()->setUseTransactions(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ class Sync
|
|||||||
if (! ($object instanceof IcingaHost || $object instanceof IcingaHostGroup)) {
|
if (! ($object instanceof IcingaHost || $object instanceof IcingaHostGroup)) {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
if ($resolver = $this->gethostGroupMembershipResolver()) {
|
if ($resolver = $this->getHostGroupMembershipResolver()) {
|
||||||
$object->setHostGroupMembershipResolver($resolver);
|
$object->setHostGroupMembershipResolver($resolver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -527,8 +527,8 @@ class Sync
|
|||||||
|
|
||||||
protected function notifyResolvers()
|
protected function notifyResolvers()
|
||||||
{
|
{
|
||||||
if ($resolver = $this->gethostGroupMembershipResolver()) {
|
if ($resolver = $this->getHostGroupMembershipResolver()) {
|
||||||
$resolver->defer();
|
$resolver->refreshDb(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -537,7 +537,7 @@ class Sync
|
|||||||
/**
|
/**
|
||||||
* @return bool|HostGroupMembershipResolver
|
* @return bool|HostGroupMembershipResolver
|
||||||
*/
|
*/
|
||||||
protected function gethostGroupMembershipResolver()
|
protected function getHostGroupMembershipResolver()
|
||||||
{
|
{
|
||||||
if ($this->hostGroupMembershipResolver === null) {
|
if ($this->hostGroupMembershipResolver === null) {
|
||||||
if (in_array(
|
if (in_array(
|
||||||
@ -688,7 +688,7 @@ class Sync
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->run->setProperties($runProperties)->store();
|
$this->run->setProperties($runProperties)->store();
|
||||||
|
$this->notifyResolvers();
|
||||||
$dba->commit();
|
$dba->commit();
|
||||||
|
|
||||||
// Store duration after commit, as the commit might take some time
|
// Store duration after commit, as the commit might take some time
|
||||||
|
Loading…
x
Reference in New Issue
Block a user