diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-06-03 07:31:31 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-06-03 07:31:31 -0600 |
commit | 83551edf3e050b5dd094fc1cff20a3f78c4d621f (patch) | |
tree | 92c2931b876d6f9922b64fb640437b7d8c539955 | |
parent | e18c37306448c5604bb50618c19d7e247fb8805f (diff) |
cmd: Only stop admin server on signal if it exists (fix #3470)
-rw-r--r-- | sigtrap.go | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 + } } } |