mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-30 17:24:18 +02:00
Sync: Make sure to prefetch relations for objects
This can avoid a lot of queries for zones, commands, timeperiods.
This commit is contained in:
parent
c4a95fd64e
commit
3b812fab7d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user