summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-06-03 07:31:31 -0600
committerMatthew Holt <mholt@users.noreply.github.com>2020-06-03 07:31:31 -0600
commit83551edf3e050b5dd094fc1cff20a3f78c4d621f (patch)
tree92c2931b876d6f9922b64fb640437b7d8c539955
parente18c37306448c5604bb50618c19d7e247fb8805f (diff)
cmd: Only stop admin server on signal if it exists (fix #3470)
-rw-r--r--sigtrap.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/sigtrap.go b/sigtrap.go
index 08f03aa..4ad94c1 100644
--- a/sigtrap.go
+++ b/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
+ }
}
}