mirror of
https://github.com/sot-tech/mochi.git
synced 2026-07-01 06:18:58 -07:00
Separate main() to allow for external inclusion
This commit is contained in:
@@ -30,11 +30,10 @@ func init() {
|
||||
flag.StringVar(&configPath, "config", "", "Provide the filesystem path of a valid configuration file.")
|
||||
}
|
||||
|
||||
func main() {
|
||||
func Boot() {
|
||||
defer glog.Flush()
|
||||
|
||||
flag.Parse()
|
||||
glog.Info("parsed flags")
|
||||
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
glog.Info("set gomaxprocs to ", runtime.NumCPU())
|
||||
@@ -68,3 +67,7 @@ func main() {
|
||||
http.Serve(cfg)
|
||||
glog.Info("gracefully shutdown")
|
||||
}
|
||||
|
||||
func main() {
|
||||
Boot()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user