mirror of
https://github.com/LBRYFoundation/tracker.git
synced 2025-08-23 17:47:29 +00:00
More idiomatic flag descriptions
This commit is contained in:
parent
ab3d49da9d
commit
2972aae231
1 changed files with 7 additions and 7 deletions
14
main.go
14
main.go
|
@ -22,14 +22,14 @@ import (
|
||||||
|
|
||||||
var (
|
var (
|
||||||
maxprocs int
|
maxprocs int
|
||||||
profile bool
|
profile string
|
||||||
configPath string
|
configPath string
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
flag.IntVar(&maxprocs, "maxprocs", runtime.NumCPU(), "Specify the amount of OS threads used by the runtime")
|
flag.IntVar(&maxprocs, "maxprocs", runtime.NumCPU(), "maximum parallel threads")
|
||||||
flag.BoolVar(&profile, "profile", false, "Generate profiling data for pprof into ./chihaya.cpu")
|
flag.StringVar(&profile, "profile", "", "if non-empty, path to write profiling data")
|
||||||
flag.StringVar(&configPath, "config", "", "Provide the filesystem path of a valid configuration file")
|
flag.StringVar(&configPath, "config", "", "path to the configuration file")
|
||||||
}
|
}
|
||||||
|
|
||||||
func Boot() {
|
func Boot() {
|
||||||
|
@ -38,10 +38,10 @@ func Boot() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
runtime.GOMAXPROCS(maxprocs)
|
runtime.GOMAXPROCS(maxprocs)
|
||||||
glog.Info("set gomaxprocs to ", maxprocs)
|
glog.Info("set max threads to ", maxprocs)
|
||||||
|
|
||||||
if profile {
|
if profile != "" {
|
||||||
f, err := os.Create("chihaya.cpu")
|
f, err := os.Create(profile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("failed to create profile file: %s\n", err)
|
glog.Fatalf("failed to create profile file: %s\n", err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue