Skip to content

Commit

Permalink
improve sync node handling
Browse files Browse the repository at this point in the history
  • Loading branch information
rodber committed Oct 29, 2023
1 parent d0738d3 commit 451334e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,18 @@ public function withRun(): RunnerInterface
$new = clone $this;
$jobs = $new->run->workflow()->jobs();
$graph = $jobs->graph()->toArray();
if (count($graph) === count($jobs)) {
foreach ($graph as $node) {
foreach ($graph as $node) {
if (count($node) === 1) {
$runner = runnerForJob($new, $node[0]);
$new->merge($new, $runner);

continue;
}
} else {
foreach ($graph as $node) {
$promises = $new->getPromises($node);
/** @var RunnerInterface[] $responses */
$responses = wait(all($promises));
foreach ($responses as $runner) {
$new->merge($new, $runner);
}
$promises = $new->getPromises($node);
/** @var RunnerInterface[] $responses */
$responses = wait(all($promises));
foreach ($responses as $runner) {
$new->merge($new, $runner);
}
}

Expand Down

0 comments on commit 451334e

Please sign in to comment.