Skip to content
Snippets Groups Projects
Verified Commit 6cbfa8c2 authored by Dave Long's avatar Dave Long
Browse files

Issue #3415821 by alexpott: StorageComparer should not wrap sourceStorage with...

Issue #3415821 by alexpott: StorageComparer should not wrap sourceStorage with a memory cache if it extends \Drupal\Core\Config\FileStorage
parent f4c7499b
No related branches found
No related tags found
No related merge requests found
......@@ -112,13 +112,21 @@ public function __construct(StorageInterface $source_storage, StorageInterface $
$target_storage = $target_storage->createCollection(StorageInterface::DEFAULT_COLLECTION);
}
// Wrap the source storage in a static cache so that multiple reads of the
// same raw configuration object are not costly.
$this->sourceCacheStorage = new MemoryBackend();
$this->sourceStorage = new CachedStorage(
$source_storage,
$this->sourceCacheStorage
);
if ($source_storage instanceof FileStorage) {
// FileStorage has its own static cache so that multiple reads of the
// same raw configuration object are not costly.
$this->sourceCacheStorage = new NullBackend('storage_comparer');
$this->sourceStorage = $source_storage;
}
else {
// Wrap the source storage in a static cache so that multiple reads of the
// same raw configuration object are not costly.
$this->sourceCacheStorage = new MemoryBackend();
$this->sourceStorage = new CachedStorage(
$source_storage,
$this->sourceCacheStorage
);
}
$this->targetCacheStorage = new MemoryBackend();
$this->targetStorage = $target_storage;
......
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