Skip to content

Commit

Permalink
Merge pull request #4219 from putyourlightson/patch-7
Browse files Browse the repository at this point in the history
Optimise Job Progress
  • Loading branch information
brandonkelly authored May 8, 2019
2 parents a338427 + 6612e9b commit 394f0a7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/queue/BaseJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,14 @@ protected function defaultDescription()
*/
protected function setProgress($queue, float $progress)
{
if ($progress !== $this->_progress && $queue instanceof QueueInterface) {
$queue->setProgress(round(100 * $progress));
$progress = round(100 * $progress);

if ($progress !== $this->_progress) {
$this->_progress = $progress;

if ($queue instanceof QueueInterface) {
$queue->setProgress($progress);
}
}
}
}

0 comments on commit 394f0a7

Please sign in to comment.