only need max procs for running

pull/2147/head
Cory LaNou 2015-04-02 10:27:35 -05:00
parent e7866d3600
commit 8fa3571782
1 changed files with 3 additions and 9 deletions

View File

@ -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)