GroupMembershipResolver: Purge IcingaTemplateRepository before refresh

This is only required with a deferred GroupMembershipResolver.
This commit is contained in:
Markus Frosch 2018-05-17 12:57:43 +02:00 committed by Thomas Gelf
parent b49d050cec
commit 8526a55e47

View File

@ -6,6 +6,7 @@ use Icinga\Application\Benchmark;
use Icinga\Data\Filter\Filter;
use Icinga\Module\Director\Db;
use Icinga\Module\Director\Db\IcingaObjectFilterHelper;
use Icinga\Module\Director\Repository\IcingaTemplateRepository;
use InvalidArgumentException;
use LogicException;
use Zend_Db_Select as ZfSelect;
@ -74,6 +75,11 @@ abstract class GroupMembershipResolver
public function refreshDb($force = false)
{
if ($force || ! $this->isDeferred()) {
if ($this->isDeferred()) {
// ensure we are not working with cached data
IcingaTemplateRepository::clear();
}
Benchmark::measure('Rechecking all objects');
$this->recheckAllObjects($this->getAppliedGroups());
Benchmark::measure('Recheck done, loading existing mappings');