mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-24 22:03:33 +08:00
cmd: Only stop admin server on signal if it exists (fix #3470)
This commit is contained in:
parent
e18c373064
commit
83551edf3e
14
sigtrap.go
14
sigtrap.go
|
@ -69,12 +69,14 @@ func gracefulStop(sigName string) {
|
|||
exitCode = ExitCodeFailedQuit
|
||||
}
|
||||
|
||||
err = stopAdminServer(adminServer)
|
||||
if err != nil {
|
||||
Log().Error("stopping admin endpoint",
|
||||
zap.String("signal", sigName),
|
||||
zap.Error(err))
|
||||
exitCode = ExitCodeFailedQuit
|
||||
if adminServer != nil {
|
||||
err = stopAdminServer(adminServer)
|
||||
if err != nil {
|
||||
Log().Error("stopping admin endpoint",
|
||||
zap.String("signal", sigName),
|
||||
zap.Error(err))
|
||||
exitCode = ExitCodeFailedQuit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user