log flags/gomaxprocs
This commit is contained in:
parent
d954378791
commit
b1311b3118
1 changed files with 4 additions and 4 deletions
8
main.go
8
main.go
|
@ -30,9 +30,11 @@ func init() {
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
glog.Info("parsed flags")
|
||||||
|
|
||||||
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
glog.Info("set gomaxprocs to ", runtime.NumCPU())
|
||||||
|
|
||||||
// Enable the profile if flagged.
|
|
||||||
if profile {
|
if profile {
|
||||||
f, err := os.Create("chihaya.cpu")
|
f, err := os.Create("chihaya.cpu")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -49,7 +51,6 @@ func main() {
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load the config file.
|
|
||||||
cfg, err := config.Open(configPath)
|
cfg, err := config.Open(configPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("failed to parse configuration file: %s\n", err)
|
glog.Fatalf("failed to parse configuration file: %s\n", err)
|
||||||
|
@ -60,7 +61,6 @@ func main() {
|
||||||
glog.Infof("loaded config file: %s", configPath)
|
glog.Infof("loaded config file: %s", configPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start the server listening and handling requests.
|
|
||||||
http.Serve(cfg)
|
http.Serve(cfg)
|
||||||
glog.Info("gracefully shutdown")
|
glog.Info("gracefully shutdown")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue