Add try/finally to ensure we always reset the max jobs
parent
b0665981c2
commit
96ad838686
|
@ -311,6 +311,7 @@ class VersionGuesser
|
||||||
|
|
||||||
$promises = [];
|
$promises = [];
|
||||||
$this->process->setMaxJobs(30);
|
$this->process->setMaxJobs(30);
|
||||||
|
try {
|
||||||
foreach ($branches as $candidate) {
|
foreach ($branches as $candidate) {
|
||||||
$candidateVersion = Preg::replace('{^remotes/\S+/}', '', $candidate);
|
$candidateVersion = Preg::replace('{^remotes/\S+/}', '', $candidate);
|
||||||
|
|
||||||
|
@ -342,8 +343,10 @@ class VersionGuesser
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->process->wait();
|
$this->process->wait();
|
||||||
|
} finally {
|
||||||
$this->process->resetMaxJobs();
|
$this->process->resetMaxJobs();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return array('version' => $version, 'pretty_version' => $prettyVersion);
|
return array('version' => $version, 'pretty_version' => $prettyVersion);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue