packer: Set GOMAXPROCS for number of CPU if n ot set
This commit is contained in:
parent
085533c17f
commit
5e17fbdaca
|
@ -8,6 +8,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -19,6 +20,11 @@ func main() {
|
||||||
log.SetOutput(os.Stderr)
|
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()
|
defer plugin.CleanupClients()
|
||||||
|
|
||||||
config, err := parseConfig(defaultConfig)
|
config, err := parseConfig(defaultConfig)
|
||||||
|
|
Loading…
Reference in New Issue