mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 11:50:55 +00:00
call cancel after shutdown
This commit is contained in:
parent
7173fd7490
commit
313be996cd
@ -268,7 +268,9 @@ func (srv *Server) shutdown() {
|
|||||||
log.Println(syscall.Getpid(), "Waiting for connections to finish...")
|
log.Println(syscall.Getpid(), "Waiting for connections to finish...")
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
if DefaultTimeout >= 0 {
|
if DefaultTimeout >= 0 {
|
||||||
ctx, _ = context.WithTimeout(context.Background(), DefaultTimeout)
|
var cancel context.CancelFunc
|
||||||
|
ctx, cancel = context.WithTimeout(context.Background(), DefaultTimeout)
|
||||||
|
defer cancel()
|
||||||
}
|
}
|
||||||
srv.terminalChan <- srv.Server.Shutdown(ctx)
|
srv.terminalChan <- srv.Server.Shutdown(ctx)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user