Skip to content

Commit 34c4829

Browse files
committed
Report Some jobs have not finished only if there are no other errors
1 parent 6c61e49 commit 34c4829

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/Parallel/ParallelAnalyser.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function analyse(
181181

182182
$job = array_pop($jobs);
183183
$process->request(['action' => 'analyse', 'files' => $job]);
184-
}, $handleError, function ($exitCode, string $output) use (&$internalErrors, $processIdentifier): void {
184+
}, $handleError, function ($exitCode, string $output) use (&$internalErrors, &$internalErrorsCount, $processIdentifier): void {
185185
$this->processPool->tryQuitProcess($processIdentifier);
186186
if ($exitCode === 0) {
187187
return;
@@ -191,14 +191,15 @@ public function analyse(
191191
}
192192

193193
$internalErrors[] = sprintf('Child process error (exit code %d): %s', $exitCode, $output);
194+
$internalErrorsCount++;
194195
});
195196
$this->processPool->attachProcess($processIdentifier, $process);
196197
}
197198

198199
$loop->run();
199200

200-
if (count($jobs) > 0) {
201-
$internalErrors[] = 'Some parallel worker jobs have not finished';
201+
if (count($jobs) > 0 && $internalErrorsCount === 0) {
202+
$internalErrors[] = 'Some parallel worker jobs have not finished.';
202203
$internalErrorsCount++;
203204
}
204205

0 commit comments

Comments
 (0)