Skip to content

Commit

Permalink
allow 0 block time
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 26, 2018
1 parent 351e3b7 commit dbad055
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Illuminate/Queue/RedisQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit dbad055

Please sign in to comment.