From 1dc847ddf7dab1e4df8df13dc732a604c9069b1a Mon Sep 17 00:00:00 2001 From: Davide Porrovecchio Date: Fri, 30 Mar 2018 23:23:49 +0200 Subject: [PATCH] Fixed check on empty queue 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. --- src/Illuminate/Queue/RedisQueue.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Queue/RedisQueue.php b/src/Illuminate/Queue/RedisQueue.php index a4d9499b63ee..7bda32fb8d3f 100644 --- a/src/Illuminate/Queue/RedisQueue.php +++ b/src/Illuminate/Queue/RedisQueue.php @@ -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']++;