mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
enhance: gracefully shutdown without error
This commit is contained in:
parent
836e25f805
commit
8119f935de
1 changed files with 1 additions and 6 deletions
7
main.go
7
main.go
|
@ -64,12 +64,7 @@ func Program(ctx context.Context, confPath string) func(l []net.Listener) error
|
|||
}
|
||||
|
||||
// defer Shutdown to wait for ongoing requests to be served before returning
|
||||
defer func(srv *http.Server, ctx context.Context) {
|
||||
err := srv.Shutdown(ctx)
|
||||
if err != nil {
|
||||
logger.Fatal(err)
|
||||
}
|
||||
}(srv, ctx)
|
||||
defer srv.Shutdown(ctx)
|
||||
|
||||
var err error
|
||||
if cSettings.ServerSettings.EnableHTTPS {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue