Skip to content
Snippets Groups Projects
Commit e96d4270 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2482231 by alexpott: Deleting configuration entities is super slow once you have a few

parent 4ad36d97
No related branches found
No related tags found
No related merge requests found
......@@ -228,16 +228,20 @@ public function uninstall($type, $name) {
*/
public function getConfigDependencyManager() {
$dependency_manager = new ConfigDependencyManager();
// This uses the configuration storage directly to avoid blowing the static
// caches in the configuration factory and the configuration entity system.
// Additionally this ensures that configuration entity dependency discovery
// has no dependencies on the config entity classes. Assume data with UUID
// is a config entity. Only configuration entities can be depended on so we
// can ignore everything else.
$data = array_filter($this->activeStorage->readMultiple($this->activeStorage->listAll()), function($config) {
return isset($config['uuid']);
});
$dependency_manager->setData($data);
// Read all configuration using the factory. This ensures that multiple
// deletes during the same request benefit from the static cache. Using the
// factory also ensures configuration entity dependency discovery has no
// dependencies on the config entity classes. Assume data with UUID is a
// config entity. Only configuration entities can be depended on so we can
// ignore everything else.
$data = array_map(function($config) {
$data = $config->get();
if (isset($data['uuid'])) {
return $data;
}
return FALSE;
}, $this->configFactory->loadMultiple($this->activeStorage->listAll()));
$dependency_manager->setData(array_filter($data));
return $dependency_manager;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment