Skip to content

Commit 9803519

Browse files
committed
The Spiral\RoadRunner\KeyValue\Cache class will set the value regardless of whether it exists or not - it always resolves the lock, you need to check for the existence of the key using the has method
1 parent f7b7c23 commit 9803519

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Cache/RoadRunnerLock.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ public function __construct(
2525
*/
2626
public function acquire()
2727
{
28+
if ($this->storage->has($this->name)) {
29+
return false;
30+
}
31+
2832
return $this->storage->set(
2933
$this->name,
3034
$this->owner,

0 commit comments

Comments
 (0)