fix linux cpu 100%

This commit is contained in:
astaxie 2013-08-09 17:49:14 +08:00
parent a2c9ff7213
commit 89acd00955
1 changed files with 5 additions and 1 deletions

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()
}
}
}