Skip to content

Commit 47ad0b8

Browse files
committed
* DatabaseQueue no longer crashes if number of attempts reaches 255+
1 parent d6f2c5a commit 47ad0b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Queue/DatabaseQueue.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function release(Task $task): bool
108108
{
109109
// Update the number of attempts and release the reservation
110110
$statement = $this->pdo->prepare('UPDATE `'.$this->options[self::OPT_TABLE_NAME].'` SET `attempts` = :attempts, `reservedAt` = NULL, `payload` = :payload WHERE `id` = :id');
111-
$statement->bindValue(':attempts', $task->attempts());
111+
$statement->bindValue(':attempts', min($task->attempts(), 255));
112112
$statement->bindValue(':payload', serialize($task));
113113
$statement->bindValue(':id', $task->id());
114114

0 commit comments

Comments
 (0)