Skip to content

Commit

Permalink
Multiprocessing - Parent process continued before all child processes…
Browse files Browse the repository at this point in the history
… where finished #219
  • Loading branch information
ctippler committed Dec 19, 2024
1 parent 3a10a66 commit edd0afd
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/ExecutionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ public static function executeChildProcesses(MonitoringItem $monitoringItem, arr
}
self::waitForChildProcesses($monitoringItem, $i, $numberOfchildProcesses);
}
self::waitForChildProcesses($monitoringItem, $i, $numberOfchildProcesses);

//make sure all child processes are finished
self::waitForChildProcesses($monitoringItem, $i, 0);
}

/**
Expand Down Expand Up @@ -332,24 +334,11 @@ protected static function childProcessCheck(MonitoringItem $monitoringItem): voi
}

}
/*
* @param int $i
* @param int $batchSize
* @param int $numberOfchildProcesses
*
* @throws \Exception
*/

/**
* @param MonitoringItem $monitoringItem
* @param int $baseline
* @param int $maxProcesses
*
* @return void
*
* @throws \Exception
*/
protected static function waitForChildProcesses(MonitoringItem $monitoringItem, int $currentBatchIteration, int $maxProcesses = 0): void
protected static function waitForChildProcesses(MonitoringItem $monitoringItem, int $currentBatchIteration, int $maxProcesses): void
{
do {
$status = $monitoringItem->getChildProcessesStatus();
Expand Down

0 comments on commit edd0afd

Please sign in to comment.