From dbad05599b2d2059e45c480fac8817d1135d5da1 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 26 Jan 2018 09:04:41 -0600 Subject: [PATCH] allow 0 block time --- src/Illuminate/Queue/RedisQueue.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Illuminate/Queue/RedisQueue.php b/src/Illuminate/Queue/RedisQueue.php index 7fd3c428990b..a4d9499b63ee 100644 --- a/src/Illuminate/Queue/RedisQueue.php +++ b/src/Illuminate/Queue/RedisQueue.php @@ -40,9 +40,9 @@ class RedisQueue extends Queue implements QueueContract /** * The maximum number of seconds to block for a job. * - * @var int + * @var int|null */ - private $blockFor = 0; + protected $blockFor = null; /** * Create a new Redis queue instance. @@ -51,10 +51,10 @@ class RedisQueue extends Queue implements QueueContract * @param string $default * @param string $connection * @param int $retryAfter - * @param int $blockFor + * @param int|null $blockFor * @return void */ - public function __construct(Redis $redis, $default = 'default', $connection = null, $retryAfter = 60, $blockFor = 0) + public function __construct(Redis $redis, $default = 'default', $connection = null, $retryAfter = 60, $blockFor = null) { $this->redis = $redis; $this->default = $default; @@ -209,7 +209,7 @@ public function migrateExpiredJobs($from, $to) */ protected function retrieveNextJob($queue) { - if ($this->blockFor >= 1) { + if (! is_null($this->blockFor)) { return $this->blockingPop($queue); }