We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af94a65 commit 93c01eaCopy full SHA for 93c01ea
pkg/client/redis/client.go
@@ -104,11 +104,18 @@ func (c *client) GetNumberSentinelSlavesInMemory(ip string, auth *util.AuthConfi
104
return 0, err
105
}
106
nSlaves := 0
107
+OUTER:
108
for _, slaveInfoBlob := range slaveInfoBlobs {
109
slaveInfo := reflect.ValueOf(slaveInfoBlob)
- slavePriority := fmt.Sprintf("%+v", slaveInfo.Index(37))
110
- if slavePriority == "1" {
111
- nSlaves += 1
+ for key, value := range slaveInfoBlob.([]interface{}) {
+ stringValue := value.(string)
112
+ if stringValue == "slave-priority" {
113
+ slavePriority := fmt.Sprintf("%+v", slaveInfo.Index(key+1))
114
+ if slavePriority == "1" {
115
+ nSlaves += 1
116
+ }
117
+ continue OUTER
118
119
120
121
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments