1
0
mirror of https://github.com/beego/bee.git synced 2024-11-21 18:40:54 +00:00

fix linux cpu 100%

This commit is contained in:
astaxie 2013-08-09 17:49:14 +08:00
parent a2c9ff7213
commit 89acd00955

6
run.go
View File

@ -67,6 +67,7 @@ var conf struct {
}
func runApp(cmd *Command, args []string) {
exit := make(chan bool)
if len(args) != 1 {
fmt.Println("[ERRO] Argument [appname] is missing")
os.Exit(2)
@ -92,7 +93,10 @@ func runApp(cmd *Command, args []string) {
appname = args[0]
Autobuild()
for {
runtime.Gosched()
select {
case <-exit:
runtime.Goexit()
}
}
}