[#306] cmd/node: Switch health status on boot and shutdown

Implement HealthChecker on node app structure. Set health status to ONLINE
after node boot. Set health status to OFFLINE on shutdown.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-13 16:36:41 +03:00 committed by Alex Vanin
parent 44a0fb5a69
commit df3746fa68
4 changed files with 20 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import (
"flag"
"log"
"github.com/nspcc-dev/neofs-node/pkg/services/private"
"github.com/nspcc-dev/neofs-node/pkg/util/grace"
"go.uber.org/zap"
)
@ -54,6 +55,8 @@ func bootUp(c *cfg) {
serveGRPC(c)
bootstrapNode(c)
startWorkers(c)
c.setHealthStatus(private.HealthStatus_ONLINE)
}
func wait(c *cfg) {