Skip to content

Commit

Permalink
CacheCompatibilityPass will also take care of FileLockRegion.
Browse files Browse the repository at this point in the history
  • Loading branch information
biozshock authored and ostrolucky committed Dec 9, 2021
1 parent 97cea21 commit 45d4f6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DependencyInjection/Compiler/CacheCompatibilityPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ private function updateSecondLevelCache(ContainerBuilder $container, Definition

$regionDefinition = $container->getDefinition($factoryMethodCall[1][0]);

// Get inner service for FileLock
if ($regionDefinition->getClass() === '%doctrine.orm.second_level_cache.filelock_region.class%') {
$regionDefinition = $container->getDefinition($regionDefinition->getArgument(0));
}

// We don't know how to adjust custom region classes
if ($regionDefinition->getClass() !== '%doctrine.orm.second_level_cache.default_region.class%') {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
'second_level_cache' => [
'enabled' => true,
'regions' => [
'filelock' => ['type' => 'filelock', 'lifetime' => 0, 'cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.system_cache_pool']],
'lifelong' => ['lifetime' => 0, 'cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.system_cache_pool']],
'entity_cache_region' => ['type' => 'service', 'service' => $this->regionClass],
],
Expand Down

0 comments on commit 45d4f6a

Please sign in to comment.