Skip to content

Commit 8817569

Browse files
Handle remove container build id correctly
1 parent 6cc7081 commit 8817569

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

DependencyInjection/Compiler/RepositoryPass.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,19 @@ public function process(ContainerBuilder $container)
3030
$managers = $container->getParameter('es.managers');
3131

3232
$hasContainerBuildId = $container->hasParameter('container.build_id');
33+
$removeContainerBuildId = false;
3334
if (!$hasContainerBuildId) {
3435
// the 'container.build_id' is required for `es.cache_engine` system cache which normally can not
3536
// be constructor inside a compiler pass. This is a workaround to make it work.
3637
// see also:
3738
// - https://github.com/symfony/symfony/blob/52a92926f7fed15cdff399c6921100a10e0d6f61/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php#L389
3839
// - https://github.com/symfony/symfony/blob/52a92926f7fed15cdff399c6921100a10e0d6f61/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php#L2322
39-
$hasContainerBuildId = true;
4040
$container->setParameter('container.build_id', hash('crc32', 'Abc123' . time()));
41+
$removeContainerBuildId = true;
4142
}
4243

4344
$collector = $container->get('es.metadata_collector');
44-
if (!$hasContainerBuildId) {
45+
if ($removeContainerBuildId) {
4546
$container->getParameterBag()->remove('container.build_id');
4647
}
4748

0 commit comments

Comments
 (0)