mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-09 08:42:33 -04:00
packer: Set GOMAXPROCS for number of CPU if n ot set
This commit is contained in:
parent
085533c17f
commit
5e17fbdaca
1 changed files with 6 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -19,6 +20,11 @@ func main() {
|
|||
log.SetOutput(os.Stderr)
|
||||
}
|
||||
|
||||
// If there is no explicit number of Go threads to use, then set it
|
||||
if os.Getenv("GOMAXPROCS") == "" {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
}
|
||||
|
||||
defer plugin.CleanupClients()
|
||||
|
||||
config, err := parseConfig(defaultConfig)
|
||||
|
|
|
|||
Loading…
Reference in a new issue