Skip to content

Commit

Permalink
In reserve method, if the payload is null, throws an error in PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
magarzon committed Feb 7, 2023
1 parent 54d3512 commit 7832933
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/drivers/redis/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ protected function reserve($timeout)
}

$payload = $this->redis->hget("$this->channel.messages", $id);
if (null === $payload) {
return null;
}

list($ttr, $message) = explode(';', $payload, 2);
$this->redis->zadd("$this->channel.reserved", time() + $ttr, $id);
$attempt = $this->redis->hincrby("$this->channel.attempts", $id, 1);
Expand Down

0 comments on commit 7832933

Please sign in to comment.