Skip to content

Commit dbad055

Browse files
committed
allow 0 block time
1 parent 351e3b7 commit dbad055

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Illuminate/Queue/RedisQueue.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ class RedisQueue extends Queue implements QueueContract
4040
/**
4141
* The maximum number of seconds to block for a job.
4242
*
43-
* @var int
43+
* @var int|null
4444
*/
45-
private $blockFor = 0;
45+
protected $blockFor = null;
4646

4747
/**
4848
* Create a new Redis queue instance.
@@ -51,10 +51,10 @@ class RedisQueue extends Queue implements QueueContract
5151
* @param string $default
5252
* @param string $connection
5353
* @param int $retryAfter
54-
* @param int $blockFor
54+
* @param int|null $blockFor
5555
* @return void
5656
*/
57-
public function __construct(Redis $redis, $default = 'default', $connection = null, $retryAfter = 60, $blockFor = 0)
57+
public function __construct(Redis $redis, $default = 'default', $connection = null, $retryAfter = 60, $blockFor = null)
5858
{
5959
$this->redis = $redis;
6060
$this->default = $default;
@@ -209,7 +209,7 @@ public function migrateExpiredJobs($from, $to)
209209
*/
210210
protected function retrieveNextJob($queue)
211211
{
212-
if ($this->blockFor >= 1) {
212+
if (! is_null($this->blockFor)) {
213213
return $this->blockingPop($queue);
214214
}
215215

0 commit comments

Comments
 (0)