Skip to content

Commit

Permalink
Removes exception when delete non exist lock
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed Nov 10, 2023
1 parent 01c8b92 commit 4e2d85b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
5 changes: 1 addition & 4 deletions src/RoadRunnerStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions tests/RoadRunnerStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 4e2d85b

Please sign in to comment.