Skip to content

Commit

Permalink
[BUG] don’t stop running if not all processes have been started
Browse files Browse the repository at this point in the history
  • Loading branch information
n3o77 committed Mar 31, 2022
1 parent 24ae153 commit 642085d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Command/ProcessRunnerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ abstract class ProcessRunnerCommand extends Command implements SignalableCommand
protected ConsoleOutputInterface $output;
protected bool $terminate = false;

protected int $totalStartedProcesses = 0;

public function __construct(
string $projectDir
) {
Expand Down Expand Up @@ -99,6 +101,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$process = $this->getProcessForCommand($command);

$process->io->writeln('Start new process');
$this->totalStartedProcesses++;

$process->start();
$process->update();
Expand All @@ -119,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
}
usleep(250000);
} while ($runningProcesses > 0);
} while ($runningProcesses > 0 || $this->totalStartedProcesses < $commandsToRunCount);


return Command::SUCCESS;
Expand Down

0 comments on commit 642085d

Please sign in to comment.