X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=internal%2Fsdlgoredis%2Fdbstate.go;h=6bbe40f912cd8550a4ebc9964f7f26a3e43964df;hb=6f724aa3950cdc01246351644348fdc0f6e9ca4a;hp=e3b9d0a2a541619ec9d9f649b61b99d4983775c4;hpb=ee834c59a83cdd10889b3439a281fe43b9f98839;p=ric-plt%2Fsdlgo.git diff --git a/internal/sdlgoredis/dbstate.go b/internal/sdlgoredis/dbstate.go index e3b9d0a..6bbe40f 100644 --- a/internal/sdlgoredis/dbstate.go +++ b/internal/sdlgoredis/dbstate.go @@ -29,6 +29,9 @@ import ( //DbState struct is a holder for DB state information, which is received from //sdlgoredis sentinel 'Master' and 'Slaves' calls output. type DbState struct { + Err error + ConfigNodeCnt int + PrimaryDbState PrimaryDbState ReplicasDbState *ReplicasDbState SentinelsDbState *SentinelsDbState @@ -90,6 +93,10 @@ type SentinelDbStateFields struct { } func (dbst *DbState) IsOnline() error { + if err := dbst.Err; err != nil { + return err + } + if err := dbst.PrimaryDbState.IsOnline(); err != nil { return err }