Skip to content

Commit 9d0dfff

Browse files
[8.x] Fix DynamoDB locks with 0 seconds duration (#43365)
* Fix DynamoDB locks with 0 seconds duration * Update DynamoDbLock.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 96aecce commit 9d0dfff

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Illuminate/Cache/DynamoDbLock.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ public function __construct(DynamoDbStore $dynamo, $name, $seconds, $owner = nul
3434
*/
3535
public function acquire()
3636
{
37-
return $this->dynamo->add(
38-
$this->name, $this->owner, $this->seconds
39-
);
37+
if ($this->seconds > 0) {
38+
return $this->dynamo->add($this->name, $this->owner, $this->seconds);
39+
} else {
40+
return $this->dynamo->add($this->name, $this->owner, 86400);
41+
}
4042
}
4143

4244
/**

0 commit comments

Comments
 (0)