diff --git a/library/Director/Import/Sync.php b/library/Director/Import/Sync.php index 593811f6..baeaee1a 100644 --- a/library/Director/Import/Sync.php +++ b/library/Director/Import/Sync.php @@ -585,9 +585,8 @@ class Sync return $this->objects; } - PrefetchCache::initialize($this->db); - $this->raiseLimits() + ->prepareCache() ->startMeasurements() ->fetchSyncProperties() ->prepareRelatedImportSources() @@ -753,4 +752,13 @@ class Sync return $this->run->id; } + + protected function prepareCache() + { + PrefetchCache::initialize($this->db); + + IcingaObject::prefetchAllRelationsByType($this->rule->object_type, $this->db); + + return $this; + } }