diff --git a/src/Commands/core/QueueCommands.php b/src/Commands/core/QueueCommands.php index 463cb19482..97e854a4bf 100644 --- a/src/Commands/core/QueueCommands.php +++ b/src/Commands/core/QueueCommands.php @@ -98,7 +98,10 @@ public function run(string $name, $options = ['time-limit' => self::REQ, 'items- $queue->garbageCollection(); } - $this->io()->progressStart($items_limit ?: $queue->numberOfItems()); + $max = $items_limit ?: $queue->numberOfItems(); + if ($max > 0) { + $this->io()->progressStart($max); + } while ((!$time_limit || $remaining > 0) && (!$items_limit || $count < $items_limit) && ($item = $queue->claimItem($lease_time))) { try { @@ -134,7 +137,9 @@ public function run(string $name, $options = ['time-limit' => self::REQ, 'items- $remaining = $end - time(); } $elapsed = microtime(true) - $start; - $this->io()->progressFinish(); + if ($max > 0) { + $this->io()->progressFinish(); + } $this->logger()->success(dt('Processed @count items from the @name queue in @elapsed sec.', ['@count' => $count, '@name' => $name, '@elapsed' => round($elapsed, 2)])); }