Skip to content

Commit af94a65

Browse files
committed
add slave num when slavePriority == 1
1 parent 4bea2da commit af94a65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/client/redis/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@ func (c *client) GetNumberSentinelSlavesInMemory(ip string, auth *util.AuthConfi
103103
if err != nil {
104104
return 0, err
105105
}
106-
nSlaves := len(slaveInfoBlobs)
106+
nSlaves := 0
107107
for _, slaveInfoBlob := range slaveInfoBlobs {
108108
slaveInfo := reflect.ValueOf(slaveInfoBlob)
109109
slavePriority := fmt.Sprintf("%+v", slaveInfo.Index(37))
110-
if slavePriority == "0" {
111-
nSlaves -= 1
110+
if slavePriority == "1" {
111+
nSlaves += 1
112112
}
113113
}
114114

0 commit comments

Comments
 (0)