From 4666a7797bcf34bba972d3d02d3dc7418392f887 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Fri, 15 Jan 2021 13:28:37 +0300 Subject: [PATCH] [#312] cmd/node: Switch health status while the application is running Switch health status to: * STARTING after the initialization of app resources and before bootup; * READY after bootup and until shutting down; * SHUTTING_DOWN before exiting the application. Signed-off-by: Leonard Lyubich --- cmd/neofs-node/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/neofs-node/main.go b/cmd/neofs-node/main.go index 47b985514..4ff55f636 100644 --- a/cmd/neofs-node/main.go +++ b/cmd/neofs-node/main.go @@ -5,6 +5,7 @@ import ( "flag" "log" + "github.com/nspcc-dev/neofs-node/pkg/services/control" "github.com/nspcc-dev/neofs-node/pkg/util/grace" "go.uber.org/zap" ) @@ -23,10 +24,16 @@ func main() { initApp(c) + c.setHealthStatus(control.HealthStatus_STARTING) + bootUp(c) + c.setHealthStatus(control.HealthStatus_READY) + wait(c) + c.setHealthStatus(control.HealthStatus_SHUTTING_DOWN) + shutdown(c) }