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