Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 9, 2021
1 parent 55a1407 commit c6ea49c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/Illuminate/Queue/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ public function daemon($connectionName, $queue, WorkerOptions $options)

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

$this->sleep($options->rest);
if ($options->rest > 0) {
$this->sleep($options->rest);
}
} else {
$this->sleep($options->sleep);
}
Expand Down
16 changes: 8 additions & 8 deletions src/Illuminate/Queue/WorkerOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ class WorkerOptions
*/
public $sleep;

/**
* The number of seconds to rest between jobs.
*
* @var int
*/
public $rest;

/**
* The maximum amount of times a job may be attempted.
*
Expand Down Expand Up @@ -74,13 +81,6 @@ class WorkerOptions
*/
public $maxTime;

/**
* The number of seconds to rest between jobs.
*
* @var int
*/
public $rest;

/**
* Create a new worker options instance.
*
Expand All @@ -103,13 +103,13 @@ public function __construct($name = 'default', $backoff = 0, $memory = 128, $tim
$this->name = $name;
$this->backoff = $backoff;
$this->sleep = $sleep;
$this->rest = $rest;
$this->force = $force;
$this->memory = $memory;
$this->timeout = $timeout;
$this->maxTries = $maxTries;
$this->stopWhenEmpty = $stopWhenEmpty;
$this->maxJobs = $maxJobs;
$this->maxTime = $maxTime;
$this->rest = $rest;
}
}

0 comments on commit c6ea49c

Please sign in to comment.