From 4e2d85b95d7d647c607acd869e91dfa678267ec2 Mon Sep 17 00:00:00 2001 From: butschster Date: Fri, 10 Nov 2023 15:13:30 +0400 Subject: [PATCH] Removes exception when delete non exist lock --- src/RoadRunnerStore.php | 5 +---- tests/RoadRunnerStoreTest.php | 4 ---- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/RoadRunnerStore.php b/src/RoadRunnerStore.php index fe79358..85ea9ff 100644 --- a/src/RoadRunnerStore.php +++ b/src/RoadRunnerStore.php @@ -109,10 +109,7 @@ public function delete(Key $key): void /** @var non-empty-string $resource */ $resource = (string)$key; - - if (false === $this->lock->release($resource, $lockId)) { - throw new LockReleasingException('RoadRunner. Failed to release lock'); - } + $this->lock->release($resource, $lockId); } public function waitAndSave(Key $key): void diff --git a/tests/RoadRunnerStoreTest.php b/tests/RoadRunnerStoreTest.php index 3180a5d..c9aa519 100644 --- a/tests/RoadRunnerStoreTest.php +++ b/tests/RoadRunnerStoreTest.php @@ -9,7 +9,6 @@ use Spiral\RoadRunner\Symfony\Lock\RoadRunnerStore; use Spiral\RoadRunner\Symfony\Lock\TokenGeneratorInterface; use Symfony\Component\Lock\Exception\LockConflictedException; -use Symfony\Component\Lock\Exception\LockReleasingException; use Symfony\Component\Lock\Key; final class RoadRunnerStoreTest extends TestCase @@ -152,9 +151,6 @@ public function testPutOffExpirationFail(): void public function testDeleteFail(): void { - $this->expectException(LockReleasingException::class); - $this->expectExceptionMessage('RoadRunner. Failed to release lock'); - $this->rrLock->expects(self::once()) ->method('release') ->with('resource-name')