Skip to content

Commit c6ea49c

Browse files
committed
formatting
1 parent 55a1407 commit c6ea49c

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/Illuminate/Queue/Worker.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ public function daemon($connectionName, $queue, WorkerOptions $options)
157157

158158
$this->runJob($job, $connectionName, $options);
159159

160-
$this->sleep($options->rest);
160+
if ($options->rest > 0) {
161+
$this->sleep($options->rest);
162+
}
161163
} else {
162164
$this->sleep($options->sleep);
163165
}

src/Illuminate/Queue/WorkerOptions.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ class WorkerOptions
3939
*/
4040
public $sleep;
4141

42+
/**
43+
* The number of seconds to rest between jobs.
44+
*
45+
* @var int
46+
*/
47+
public $rest;
48+
4249
/**
4350
* The maximum amount of times a job may be attempted.
4451
*
@@ -74,13 +81,6 @@ class WorkerOptions
7481
*/
7582
public $maxTime;
7683

77-
/**
78-
* The number of seconds to rest between jobs.
79-
*
80-
* @var int
81-
*/
82-
public $rest;
83-
8484
/**
8585
* Create a new worker options instance.
8686
*
@@ -103,13 +103,13 @@ public function __construct($name = 'default', $backoff = 0, $memory = 128, $tim
103103
$this->name = $name;
104104
$this->backoff = $backoff;
105105
$this->sleep = $sleep;
106+
$this->rest = $rest;
106107
$this->force = $force;
107108
$this->memory = $memory;
108109
$this->timeout = $timeout;
109110
$this->maxTries = $maxTries;
110111
$this->stopWhenEmpty = $stopWhenEmpty;
111112
$this->maxJobs = $maxJobs;
112113
$this->maxTime = $maxTime;
113-
$this->rest = $rest;
114114
}
115115
}

0 commit comments

Comments
 (0)