log flags/gomaxprocs

This commit is contained in:
Jimmy Zelinskie 2014-07-02 00:45:17 -04:00
parent d954378791
commit b1311b3118

View file

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