mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 17:00:55 +00:00
add shutdown log
This commit is contained in:
parent
313be996cd
commit
e295c3c7c3
@ -39,9 +39,11 @@ func (srv *Server) Serve() (err error) {
|
|||||||
// immediately return ErrServerClosed. Make sure the program doesn't exit
|
// immediately return ErrServerClosed. Make sure the program doesn't exit
|
||||||
// and waits instead for Shutdown to return.
|
// and waits instead for Shutdown to return.
|
||||||
if err = srv.Server.Serve(srv.ln); err != nil && err != http.ErrServerClosed {
|
if err = srv.Server.Serve(srv.ln); err != nil && err != http.ErrServerClosed {
|
||||||
|
log.Println(syscall.Getpid(), "Server.Serve() error:", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Println(syscall.Getpid(), srv.ln.Addr(), "Listener closed.")
|
||||||
// wait for Shutdown to return
|
// wait for Shutdown to return
|
||||||
return <-srv.terminalChan
|
return <-srv.terminalChan
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user