X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=internal%2Fsdlgoredis%2Fsdlgoredis.go;fp=internal%2Fsdlgoredis%2Fsdlgoredis.go;h=cefe4be971fb826da9e43cbbdd192a3331ea2c92;hb=ee834c59a83cdd10889b3439a281fe43b9f98839;hp=5f649600ce598b2ead2a9dffbbbdf9c1062f5ae6;hpb=a5bd11af229cdcbfc973c0b4ab67a9c75f4f76e1;p=ric-plt%2Fsdlgo.git diff --git a/internal/sdlgoredis/sdlgoredis.go b/internal/sdlgoredis/sdlgoredis.go index 5f64960..cefe4be 100644 --- a/internal/sdlgoredis/sdlgoredis.go +++ b/internal/sdlgoredis/sdlgoredis.go @@ -497,13 +497,14 @@ func readRedisInfoReplyFields(input []string, info *DbInfo) { if idx := strings.Index(line, "role:"); idx != -1 { roleStr := line[idx+len("role:"):] if roleStr == "master" { - info.Fields.MasterRole = true + info.Fields.PrimaryRole = true } } else if idx := strings.Index(line, "connected_slaves:"); idx != -1 { cntStr := line[idx+len("connected_slaves:"):] if cnt, err := strconv.ParseUint(cntStr, 10, 32); err == nil { info.Fields.ConnectedReplicaCnt = uint32(cnt) } + } } } @@ -531,10 +532,10 @@ func (db *DB) State() (*DbState, error) { func fillDbStateFromDbInfo(info *DbInfo) DbState { var dbState DbState - if info.Fields.MasterRole == true { + if info.Fields.PrimaryRole == true { dbState = DbState{ - MasterDbState: MasterDbState{ - Fields: MasterDbStateFields{ + PrimaryDbState: PrimaryDbState{ + Fields: PrimaryDbStateFields{ Role: "master", Flags: "master", },