Skip to content

Commit

Permalink
fix: clear missing metadata pools (#4770)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain authored and soyuka committed Jun 29, 2022
1 parent d563280 commit c76720e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use ApiPlatform\State\ProviderInterface;
use ApiPlatform\Symfony\Validator\Metadata\Property\Restriction\PropertySchemaRestrictionMetadataInterface;
use ApiPlatform\Symfony\Validator\ValidationGroupsGeneratorInterface;
use Symfony\Component\Cache\Adapter\ArrayAdapter;
use phpDocumentor\Reflection\DocBlockFactoryInterface;
use Ramsey\Uuid\Uuid;
use Symfony\Component\Config\FileLocator;
Expand Down Expand Up @@ -500,6 +501,13 @@ private function registerCacheConfiguration(ContainerBuilder $container): void
if (!$container->hasParameter('kernel.debug') || !$container->getParameter('kernel.debug')) {
$container->removeDefinition('api_platform.cache_warmer.cache_pool_clearer');
}

$container->register('api_platform.cache.metadata.property', ArrayAdapter::class);
$container->register('api_platform.cache.metadata.resource', ArrayAdapter::class);
$container->register('api_platform.cache.metadata.resource_collection', ArrayAdapter::class);
$container->register('api_platform.cache.route_name_resolver', ArrayAdapter::class);
$container->register('api_platform.cache.identifiers_extractor', ArrayAdapter::class);
$container->register('api_platform.elasticsearch.cache.metadata.document', ArrayAdapter::class);
}

private function registerDoctrineOrmConfiguration(ContainerBuilder $container, array $config, XmlFileLoader $loader): void
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Bundle/Resources/config/symfony/events.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@
<argument type="service" id="cache.system_clearer" />
<argument type="collection">
<argument>api_platform.cache.metadata.property</argument>
<argument>api_platform.cache.metadata.property.legacy</argument>
<argument>api_platform.cache.metadata.resource</argument>
<argument>api_platform.cache.metadata.resource.legacy</argument>
<argument>api_platform.cache.metadata.resource_collection</argument>
<argument>api_platform.cache.route_name_resolver</argument>
<argument>api_platform.cache.identifiers_extractor</argument>
Expand Down

0 comments on commit c76720e

Please sign in to comment.