File tree 1 file changed +4
-2
lines changed
src/Symfony/Component/HttpKernel
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -670,9 +670,11 @@ protected function initializeContainer()
670
670
// Because concurrent requests might still be using them,
671
671
// old container files are not removed immediately,
672
672
// but on a next dump of the container.
673
+ static $ legacyContainers = array ();
673
674
$ oldContainerDir = dirname ($ oldContainer ->getFileName ());
674
- foreach (glob (dirname ($ oldContainerDir ).'/*.legacy ' ) as $ legacyContainer ) {
675
- if ($ oldContainerDir .'.legacy ' !== $ legacyContainer && @unlink ($ legacyContainer )) {
675
+ $ legacyContainers [$ oldContainerDir .'.legacy ' ] = true ;
676
+ foreach (glob (dirname ($ oldContainerDir ).DIRECTORY_SEPARATOR .'*.legacy ' ) as $ legacyContainer ) {
677
+ if (!isset ($ legacyContainers [$ legacyContainer ]) && @unlink ($ legacyContainer )) {
676
678
(new Filesystem ())->remove (substr ($ legacyContainer , 0 , -7 ));
677
679
}
678
680
}
You can’t perform that action at this time.
0 commit comments