Commit 2d768c3c authored by Mrs4s's avatar Mrs4s

fix exit.

parent 1feb44d6
...@@ -77,7 +77,9 @@ func (s *webServer) Run(addr string, cli *client.QQClient) *coolq.CQBot { ...@@ -77,7 +77,9 @@ func (s *webServer) Run(addr string, cli *client.QQClient) *coolq.CQBot {
if err != nil { if err != nil {
log.Error(err) log.Error(err)
log.Infof("请检查端口是否被占用.") log.Infof("请检查端口是否被占用.")
time.Sleep(time.Second * 5) c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, os.Kill)
<-c
os.Exit(1) os.Exit(1)
} }
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment