From b289b443ccd75035fe5e32674657ca1471536404 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Thu, 29 Sep 2022 21:14:13 +0800 Subject: [PATCH] mv tmNode stop --- server/start.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/server/start.go b/server/start.go index 37fda13238..c4ba5412f2 100644 --- a/server/start.go +++ b/server/start.go @@ -339,6 +339,13 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty logger.Error("failed start tendermint server", "error", err.Error()) return err } + + defer func() { + if tmNode.IsRunning() { + _ = tmNode.Stop() + } + logger.Info("Bye!") + }() } // Add the tx service to the gRPC router. We only need to register this @@ -545,14 +552,6 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty case <-time.After(types.ServerStartTime): // assume server started successfully } } - - defer func() { - if tmNode != nil && tmNode.IsRunning() { - _ = tmNode.Stop() - } - logger.Info("Bye!") - }() - // Wait for SIGINT or SIGTERM signal return server.WaitForQuitSignals() }