1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 18:20:50 +00:00

Make parent process exit gracefully.

With beego.BConfig.Listen.Graceful  enabled, when received SIGHUP, we'll fork a child process.
But the parent process still have jobs to finish, So we can't kill the parent process directly.
This commit is contained in:
iclinux 2017-09-05 11:53:42 +08:00 committed by GitHub
parent d96289a81b
commit 1dd50fb65f

View File

@ -65,7 +65,7 @@ func (srv *Server) ListenAndServe() (err error) {
log.Println(err)
return err
}
err = process.Kill()
err = process.Signal(syscall.SIGTERM)
if err != nil {
return err
}
@ -120,7 +120,7 @@ func (srv *Server) ListenAndServeTLS(certFile, keyFile string) (err error) {
log.Println(err)
return err
}
err = process.Kill()
err = process.Signal(syscall.SIGTERM)
if err != nil {
return err
}