Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
mv tmNode stop
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Sep 29, 2022
1 parent 5a73c52 commit b289b44
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit b289b44

Please sign in to comment.