mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 01:04:12 +02:00
GroupMembershipResolver: Purge IcingaTemplateRepository before refresh
This is only required with a deferred GroupMembershipResolver.
This commit is contained in:
parent
b49d050cec
commit
8526a55e47
@ -6,6 +6,7 @@ use Icinga\Application\Benchmark;
|
|||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
|
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
|
||||||
|
use Icinga\Module\Director\Repository\IcingaTemplateRepository;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
use Zend_Db_Select as ZfSelect;
|
use Zend_Db_Select as ZfSelect;
|
||||||
@ -74,6 +75,11 @@ abstract class GroupMembershipResolver
|
|||||||
public function refreshDb($force = false)
|
public function refreshDb($force = false)
|
||||||
{
|
{
|
||||||
if ($force || ! $this->isDeferred()) {
|
if ($force || ! $this->isDeferred()) {
|
||||||
|
if ($this->isDeferred()) {
|
||||||
|
// ensure we are not working with cached data
|
||||||
|
IcingaTemplateRepository::clear();
|
||||||
|
}
|
||||||
|
|
||||||
Benchmark::measure('Rechecking all objects');
|
Benchmark::measure('Rechecking all objects');
|
||||||
$this->recheckAllObjects($this->getAppliedGroups());
|
$this->recheckAllObjects($this->getAppliedGroups());
|
||||||
Benchmark::measure('Recheck done, loading existing mappings');
|
Benchmark::measure('Recheck done, loading existing mappings');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user