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:
parent
f5921774fd
commit
8decc34cce
1 changed files with 6 additions and 1 deletions
7
main.go
7
main.go
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in a new issue