Skip to content

Commit 8fdb3c0

Browse files
committed
initialWaitTtl
1 parent d15bfa8 commit 8fdb3c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/RoadRunnerStore.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ final class RoadRunnerStore implements SharedLockStoreInterface
1717
public function __construct(
1818
private readonly RrLockInterface $rrLock,
1919
private float $initialTtl = 300.0,
20+
private float $initialWaitTtl = 0,
2021
) {
2122
}
2223

2324
public function save(Key $key): void
2425
{
2526
\assert(false === $key->hasState(__CLASS__));
2627
try {
27-
$lockId = $this->rrLock->lock((string) $key, null, $this->initialTtl);
28+
$lockId = $this->rrLock->lock((string) $key, null, $this->initialTtl, $this->initialWaitTtl);
2829
if (false === $lockId) {
2930
throw new LockConflictedException('RoadRunner. Failed to make lock');
3031
}
@@ -37,7 +38,7 @@ public function save(Key $key): void
3738
public function saveRead(Key $key): void
3839
{
3940
\assert(false === $key->hasState(__CLASS__));
40-
$lockId = $this->rrLock->lockRead((string)$key, null, $this->initialTtl);
41+
$lockId = $this->rrLock->lockRead((string)$key, null, $this->initialTtl, $this->initialWaitTtl);
4142
if (false === $lockId) {
4243
throw new LockConflictedException('RoadRunner. Failed to make read lock');
4344
}

0 commit comments

Comments
 (0)