mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 11:10:57 +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
|
||||
// and waits instead for Shutdown to return.
|
||||
if err = srv.Server.Serve(srv.ln); err != nil && err != http.ErrServerClosed {
|
||||
log.Println(syscall.Getpid(), "Server.Serve() error:", err)
|
||||
return err
|
||||
}
|
||||
|
||||
log.Println(syscall.Getpid(), srv.ln.Addr(), "Listener closed.")
|
||||
// wait for Shutdown to return
|
||||
return <-srv.terminalChan
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user