diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index d26a8e6e..a1ad4376 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -60,6 +60,7 @@ type ( statusIndex *innerRingIndexer precision precision.Fixed8Converter auditClient *auditWrapper.ClientWrapper + healthStatus atomic.Value // notary configuration feeConfig *config.FeeConfig diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index 310f5e01..abe90cb5 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -6,6 +6,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neofs-node/pkg/services/audit" + control "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" "go.uber.org/zap" ) @@ -130,3 +131,12 @@ func (s *Server) WriteReport(r *audit.Report) error { func (s *Server) ResetEpochTimer() error { return s.epochTimer.Reset() } + +func (s *Server) setHealthStatus(hs control.HealthStatus) { + s.healthStatus.Store(hs) +} + +// HealthStatus returns current health status of IR application. +func (s *Server) HealthStatus() control.HealthStatus { + return s.healthStatus.Load().(control.HealthStatus) +}