From be8cbd2aec5c99d901e611945ecfb33e569cb1c9 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Tue, 28 Dec 2021 11:59:47 +0100 Subject: [PATCH] [Cache] Don't lock when doing nested computations --- src/Symfony/Component/Cache/LockRegistry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/LockRegistry.php b/src/Symfony/Component/Cache/LockRegistry.php index 70fcac9cc12af..20fba4d3d4da4 100644 --- a/src/Symfony/Component/Cache/LockRegistry.php +++ b/src/Symfony/Component/Cache/LockRegistry.php @@ -88,7 +88,7 @@ public static function compute(callable $callback, ItemInterface $item, bool &$s $key = self::$files ? abs(crc32($item->getKey())) % \count(self::$files) : -1; - if ($key < 0 || (self::$lockedFiles[$key] ?? false) || !$lock = self::open($key)) { + if ($key < 0 || self::$lockedFiles || !$lock = self::open($key)) { return $callback($item, $save); }