Skip to content

Commit 57ad6e4

Browse files
committed
WIP
1 parent f4eeed8 commit 57ad6e4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PatternLibraryCollector.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function __construct(
111111
*/
112112
public static function create(ContainerInterface $container): self {
113113
/** @var \Drupal\Core\Cache\CacheBackendInterface $cache */
114-
$cache = $container->get('cache.discovery');
114+
$cache = $container->get('cache.default');
115115
/** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
116116
$config_factory = $container->get('config.factory');
117117
/** @var \Drupal\patternkit\PatternLibraryPluginManager $library_plugin_manager */
@@ -159,8 +159,13 @@ public function getLibraryDefinitions(): array {
159159
// (if cache enabled, otherwise just a slow, redundant memcache set).
160160
if ($cache_enabled) {
161161
// Explicit copy of the data into cache_set to avoid implicit copy.
162+
// @todo Evaluate encoding via JSON instead to shrink data size.
162163
$this->cache->set(static::PERSISTENT_CACHE_ID,
163164
$cached_metadata);
165+
$cache = $this->cache->get(static::PERSISTENT_CACHE_ID);
166+
if ($cache->data !== $cached_metadata) {
167+
// @todo THROW AN ERROR CAUSE WE BROKE.
168+
}
164169
}
165170
}
166171
return $cached_metadata;

0 commit comments

Comments
 (0)