Skip to content

Commit 4e2d85b

Browse files
committed
Removes exception when delete non exist lock
1 parent 01c8b92 commit 4e2d85b

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/RoadRunnerStore.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,7 @@ public function delete(Key $key): void
109109

110110
/** @var non-empty-string $resource */
111111
$resource = (string)$key;
112-
113-
if (false === $this->lock->release($resource, $lockId)) {
114-
throw new LockReleasingException('RoadRunner. Failed to release lock');
115-
}
112+
$this->lock->release($resource, $lockId);
116113
}
117114

118115
public function waitAndSave(Key $key): void

tests/RoadRunnerStoreTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Spiral\RoadRunner\Symfony\Lock\RoadRunnerStore;
1010
use Spiral\RoadRunner\Symfony\Lock\TokenGeneratorInterface;
1111
use Symfony\Component\Lock\Exception\LockConflictedException;
12-
use Symfony\Component\Lock\Exception\LockReleasingException;
1312
use Symfony\Component\Lock\Key;
1413

1514
final class RoadRunnerStoreTest extends TestCase
@@ -152,9 +151,6 @@ public function testPutOffExpirationFail(): void
152151

153152
public function testDeleteFail(): void
154153
{
155-
$this->expectException(LockReleasingException::class);
156-
$this->expectExceptionMessage('RoadRunner. Failed to release lock');
157-
158154
$this->rrLock->expects(self::once())
159155
->method('release')
160156
->with('resource-name')

0 commit comments

Comments
 (0)