From c0f3039fc35e4fcd6e66cf399252d8472ae22d8a Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Thu, 10 Dec 2020 12:37:57 +0100 Subject: [PATCH] make it exit gracefully. (#8101) * make it exit gracefully. * add kig message * git update error code * exit with error code * exit with 0 * Update server/start.go Co-authored-by: SaReN Co-authored-by: Alessio Treglia --- server/start.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/start.go b/server/start.go index d3af7db42c..011f3496db 100644 --- a/server/start.go +++ b/server/start.go @@ -115,7 +115,13 @@ which accepts a path for the resulting pprof file. // amino is needed here for backwards compatibility of REST routes err := startInProcess(serverCtx, clientCtx, appCreator) - return err + errCode, ok := err.(ErrorCode) + if !ok { + return err + } + + serverCtx.Logger.Debug(fmt.Sprintf("received quit signal: %d", errCode.Code)) + return nil }, }