Add try/finally to ensure we always reset the max jobs

main
Jordi Boggiano 2 years ago
parent b0665981c2
commit 96ad838686
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -311,6 +311,7 @@ class VersionGuesser
$promises = [];
$this->process->setMaxJobs(30);
try {
foreach ($branches as $candidate) {
$candidateVersion = Preg::replace('{^remotes/\S+/}', '', $candidate);
@ -342,8 +343,10 @@ class VersionGuesser
}
$this->process->wait();
} finally {
$this->process->resetMaxJobs();
}
}
return array('version' => $version, 'pretty_version' => $prettyVersion);
}

Loading…
Cancel
Save