1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-10 03:50:17 +00:00

fix panic: sync: negative WaitGroup counter

This commit is contained in:
sanghee
2019-01-03 22:44:32 +09:00
parent 5fe19d639f
commit bf15535a5b
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,11 @@ type Server struct {
// creating a new service goroutine for each.
// The service goroutines read requests and then call srv.Handler to reply to them.
func (srv *Server) Serve() (err error) {
defer func() {
if r := recover(); r != nil {
log.Println("wait group counter is negative", r)
}
}()
srv.state = StateRunning
err = srv.Server.Serve(srv.GraceListener)
log.Println(syscall.Getpid(), "Waiting for connections to finish...")