only need max procs for running
parent
e7866d3600
commit
8fa3571782
|
@ -74,13 +74,11 @@ func main() {
|
|||
case "":
|
||||
execRun(args)
|
||||
case "backup":
|
||||
setGoMaxProcs()
|
||||
cmd := NewBackupCommand()
|
||||
if err := cmd.Run(args[1:]...); err != nil {
|
||||
log.Fatalf("backup: %s", err)
|
||||
}
|
||||
case "restore":
|
||||
setGoMaxProcs()
|
||||
cmd := NewRestoreCommand()
|
||||
if err := cmd.Run(args[1:]...); err != nil {
|
||||
log.Fatalf("restore: %s", err)
|
||||
|
@ -96,12 +94,6 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
func setGoMaxProcs() {
|
||||
// Set parallelism.
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
log.Printf("GOMAXPROCS set to %d", runtime.GOMAXPROCS(0))
|
||||
}
|
||||
|
||||
// execRun runs the "run" command.
|
||||
func execRun(args []string) {
|
||||
// Parse command flags.
|
||||
|
@ -125,7 +117,9 @@ func execRun(args []string) {
|
|||
fmt.Print(logo)
|
||||
writePIDFile(*pidPath)
|
||||
|
||||
setGoMaxProcs()
|
||||
// Set parallelism.
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
log.Printf("GOMAXPROCS set to %d", runtime.GOMAXPROCS(0))
|
||||
|
||||
// Parse configuration file from disk.
|
||||
config, err := parseConfig(*configPath, *hostname)
|
||||
|
|
Loading…
Reference in New Issue