Skip to content

Commit

Permalink
cmd: Only stop admin server on signal if it exists (fix #3470)
Browse files Browse the repository at this point in the history
  • Loading branch information
mholt committed Jun 3, 2020
1 parent e18c373 commit 83551ed
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sigtrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 83551ed

Please sign in to comment.