From 35f53386bc8c3b218c64fdef7de28353c5b07466 Mon Sep 17 00:00:00 2001 From: Veselin Kulov Date: Fri, 31 Jan 2025 10:46:53 +0200 Subject: [PATCH] Fix race condition checking if event mutex exists --- src/Illuminate/Console/Scheduling/CacheEventMutex.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Console/Scheduling/CacheEventMutex.php b/src/Illuminate/Console/Scheduling/CacheEventMutex.php index 3d1ad9247a1b..e6c16c6935a4 100644 --- a/src/Illuminate/Console/Scheduling/CacheEventMutex.php +++ b/src/Illuminate/Console/Scheduling/CacheEventMutex.php @@ -61,9 +61,8 @@ public function create(Event $event) public function exists(Event $event) { if ($this->shouldUseLocks($this->cache->store($this->store)->getStore())) { - return ! $this->cache->store($this->store)->getStore() - ->lock($event->mutexName(), $event->expiresAt * 60) - ->get(fn () => true); + return $this->cache->store($this->store)->getStore() + ->get($event->mutexName()) !== null; } return $this->cache->store($this->store)->has($event->mutexName());