diff --git a/service/main.go b/service/main.go index b449ca7..02be369 100644 --- a/service/main.go +++ b/service/main.go @@ -22,7 +22,6 @@ var ( status = flag.String("status", "", "Path to status file") keep = flag.Int("keep", 100, "Count of status files") debug = flag.Bool("debug", false, "debug") - pprof = flag.String("pprof", "", "pprof port") ) const commonFlag = ` @@ -108,6 +107,7 @@ func main() { flag.Usage = func() { fmt.Fprintf(flag.CommandLine.Output(), `Usage of %s:%s%s%s%s`, os.Args[0], commonFlag, serverFlag, clientFlag, svc.Usage()) } + flag.StringVar(&svc.DebugAddr, "pprof", "", "pprof port") flag.StringVar(&svc.Options.UpdateURL, "update", "", "Update URL") flags.SetConfigFile(filepath.Join(filepath.Dir(self), "config.ini")) flags.Parse() diff --git a/service/run.go b/service/run.go index ae2207c..b5e4972 100644 --- a/service/run.go +++ b/service/run.go @@ -2,8 +2,6 @@ package main import ( "net" - "net/http" - _ "net/http/pprof" "net/url" "strconv" @@ -21,11 +19,6 @@ type Runner interface { } func run() error { - if addr := *pprof; addr != "" { - go func() { - svc.Print(http.ListenAndServe(addr, nil)) - }() - } base := NewBase(*host, *port) base.ErrorLog = errorLogger.Logger servers := []*httpsvr.Server{base.Server}