1
0
Fork 0
mirror of https://github.com/Luzifer/update-gotools.git synced 2024-12-22 12:51:20 +00:00

Fix: Ensure the tool works on VMs with 1 CPU

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-02-21 10:35:45 +01:00
parent f5921774fd
commit 8decc34cce
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -69,8 +69,13 @@ func main() {
"num_cpu": runtime.NumCPU(),
}).Debugf("update-gotools started")
parallelRunners := runtime.NumCPU() - 1
if parallelRunners < 1 {
parallelRunners = 1
}
runPreCommands()
runPackageBuilds(runtime.NumCPU()-1, func(pkg pkgCfg) bool { return !pkg.Single })
runPackageBuilds(parallelRunners, func(pkg pkgCfg) bool { return !pkg.Single })
runPackageBuilds(1, func(pkg pkgCfg) bool { return pkg.Single })
runPostCommands()