Skip to content

Commit

Permalink
[REF] when terminating make sure all child processes are terminated a…
Browse files Browse the repository at this point in the history
…s well
  • Loading branch information
n3o77 committed Mar 31, 2022
1 parent 4d1d6ba commit f210acc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Command/ProcessRunnerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$lastStart = null;
$nextDelay = 0;
do {
if ($this->terminate) {
break;
}
$runningProcesses = $this->countRunningProcesses();
if (!$this->terminate && $runningProcesses < $this->maxConcurrentProcesses && count($commandsToRun) > 0) {
if (!$lastStart || (time() - $lastStart) >= $nextDelay) {
Expand Down Expand Up @@ -124,6 +121,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->updateOverviewForProcess($subProcess);
}
}
if ($this->terminate && $runningProcesses === 0) {
break;
}
usleep(250000);
} while ($runningProcesses > 0 || $this->totalStartedProcesses < $commandsToRunCount);

Expand Down

0 comments on commit f210acc

Please sign in to comment.