예제 #1
0
파일: mysvrs.go 프로젝트: sunbin728/mysvrs
func main() {
	flag.Parse()
	gomax := int(float64(runtime.NumCPU()) * 1.5)
	runtime.GOMAXPROCS(gomax)

	signalChan := make(chan os.Signal, 1)
	signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM)

	log.InitFromFile(*logconf)
	log.Info("version:%v", util.GetVersion())
	log.Info("start...")

	Init()

	go myweb.Start(config.SConfig.Http, config.SConfig.Https)
	log.Info("Welcome to mysvrs")

	<-signalChan
	log.Info("bye")
	os.Exit(0)

}
예제 #2
0
func verhandler(w http.ResponseWriter, r *http.Request) {
	var wel string = fmt.Sprintf("Welcom to mysvrs, you are the %dth visitor.", visitcount)
	fmt.Fprintln(w, wel)
	fmt.Fprintln(w, util.GetVersion())
	fmt.Fprintln(w, startTime)
}