Skip to content

Commit

Permalink
Fixed check on empty queue (#23757)
Browse files Browse the repository at this point in the history
When using phpredis, `blpop` returns an empty array if no elements are found in the list.
This can be easily deduced looking at [this test](https://github.com/phpredis/phpredis/blob/300c72510c48e210338826b713f260a4eda8abc7/tests/RedisTest.php#L833).

Fix #23756.
  • Loading branch information
pdavide authored and taylorotwell committed Mar 31, 2018
1 parent a9218a9 commit 570b489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Queue/RedisQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ protected function blockingPop($queue)
{
$rawBody = $this->getConnection()->blpop($queue, $this->blockFor);

if (! is_null($rawBody)) {
if (! empty($rawBody)) {
$payload = json_decode($rawBody[1], true);

$payload['attempts']++;
Expand Down

0 comments on commit 570b489

Please sign in to comment.