File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments