forked from TrueCloudLab/frostfs-node
[#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 <leonard@nspcc.ru>
This commit is contained in:
parent
147399f547
commit
4666a7797b
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue