Skip to content

Commit 49a19ea

Browse files
committed
[Bridge] Fix mkdir() race condition in ProxyCacheWarmer
1 parent 5d5a797 commit 49a19ea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CacheWarmer/ProxyCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function warmUp($cacheDir)
4949
foreach ($this->registry->getManagers() as $em) {
5050
// we need the directory no matter the proxy cache generation strategy
5151
if (!is_dir($proxyCacheDir = $em->getConfiguration()->getProxyDir())) {
52-
if (false === @mkdir($proxyCacheDir, 0777, true)) {
52+
if (false === @mkdir($proxyCacheDir, 0777, true) && !is_dir($proxyCacheDir)) {
5353
throw new \RuntimeException(sprintf('Unable to create the Doctrine Proxy directory "%s".', $proxyCacheDir));
5454
}
5555
} elseif (!is_writable($proxyCacheDir)) {

0 commit comments

Comments
 (0)