diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 850a8b6fc..2f02babec 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -184,6 +184,8 @@ type cfg struct { cfgControlService cfgControlService + netStatus *atomic.Int32 + healthStatus *atomic.Int32 } @@ -342,7 +344,8 @@ func initCfg(path string) *cfg { cfgObject: cfgObject{ pool: initObjectPool(viperCfg), }, - healthStatus: atomic.NewInt32(int32(control.NetmapStatus_STATUS_UNDEFINED)), + netStatus: atomic.NewInt32(int32(control.NetmapStatus_STATUS_UNDEFINED)), + healthStatus: atomic.NewInt32(int32(control.HealthStatus_HEALTH_STATUS_UNDEFINED)), } initLocalStorage(c) diff --git a/cmd/neofs-node/control.go b/cmd/neofs-node/control.go index ed9572cc3..0b09ff8e4 100644 --- a/cmd/neofs-node/control.go +++ b/cmd/neofs-node/control.go @@ -69,9 +69,17 @@ func initControlService(c *cfg) { } func (c *cfg) setNetmapStatus(st control.NetmapStatus) { - c.healthStatus.Store(int32(st)) + c.netStatus.Store(int32(st)) } func (c *cfg) NetmapStatus() control.NetmapStatus { - return control.NetmapStatus(c.healthStatus.Load()) + return control.NetmapStatus(c.netStatus.Load()) +} + +func (c *cfg) setHealthStatus(st control.HealthStatus) { + c.healthStatus.Store(int32(st)) +} + +func (c *cfg) HealthStatus() control.HealthStatus { + return control.HealthStatus(c.healthStatus.Load()) }