mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
cmd: Only stop admin server on signal if it exists (fix #3470)
This commit is contained in:
parent
e18c373064
commit
83551edf3e
1 changed files with 8 additions and 6 deletions
14
sigtrap.go
14
sigtrap.go
|
@ -69,12 +69,14 @@ func gracefulStop(sigName string) {
|
||||||
exitCode = ExitCodeFailedQuit
|
exitCode = ExitCodeFailedQuit
|
||||||
}
|
}
|
||||||
|
|
||||||
err = stopAdminServer(adminServer)
|
if adminServer != nil {
|
||||||
if err != nil {
|
err = stopAdminServer(adminServer)
|
||||||
Log().Error("stopping admin endpoint",
|
if err != nil {
|
||||||
zap.String("signal", sigName),
|
Log().Error("stopping admin endpoint",
|
||||||
zap.Error(err))
|
zap.String("signal", sigName),
|
||||||
exitCode = ExitCodeFailedQuit
|
zap.Error(err))
|
||||||
|
exitCode = ExitCodeFailedQuit
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue