Don't spam the terminal. No beuno.
This commit is contained in:
parent
b1bba4cbfb
commit
1049d2dbd7
1 changed files with 4 additions and 1 deletions
|
|
@ -19,6 +19,8 @@ abstract class AbstractQueueWorker extends AbstractWorker
|
|||
|
||||
protected bool $showRemainingQueueLength = true;
|
||||
|
||||
protected int $lastLength = -1;
|
||||
|
||||
public function __construct(
|
||||
QueueService $queueService,
|
||||
Logger $logger,
|
||||
|
|
@ -95,12 +97,13 @@ abstract class AbstractQueueWorker extends AbstractWorker
|
|||
public function iterate(): bool
|
||||
{
|
||||
$queueLength = $this->queueService->getQueueLength($this->inputQueue);
|
||||
if ($this->showRemainingQueueLength) {
|
||||
if ($this->showRemainingQueueLength && $queueLength != $this->lastLength) {
|
||||
$this->logger->debug(sprintf(
|
||||
'Queue %s Length: %d',
|
||||
$this->inputQueue,
|
||||
$queueLength
|
||||
));
|
||||
$this->lastLength = $queueLength;
|
||||
}
|
||||
|
||||
if (isset($this->cliArguments['stop-on-zero']) && true === $this->cliArguments['stop-on-zero'] && 0 == $queueLength) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue