Skip to content

Commit 862e101

Browse files
In case of different slot groups count and node count ensure we iterate over nodes and node slots (#17)
1 parent 8f728aa commit 862e101

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

subscriber.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,13 @@ func main() {
202202
}
203203
nodeCount, nodeClients, nodesAddresses = updateSecondarySlicesCluster(clusterClient, ctx)
204204
}
205+
206+
log.Println(fmt.Sprintf("Detailing final setup used for benchmark."))
207+
log.Println(fmt.Sprintf("\tTotal nodes: %d", nodeCount))
208+
for i, nodeAddress := range nodesAddresses {
209+
log.Println(fmt.Sprintf("\tnode #%d: Address: %s", i, nodeAddress))
210+
log.Println(fmt.Sprintf("\t\tClient struct: %v", nodeClients[i]))
211+
}
205212
// trap Ctrl+C and call cancel on the context
206213
// We Use this instead of the previous stopChannel + chan radix.PubSubMessage
207214
ctx, cancel := context.WithCancel(ctx)
@@ -348,7 +355,7 @@ func updateSecondarySlicesCluster(clusterClient *redis.ClusterClient, ctx contex
348355
return
349356
}
350357
clusterClient.ForEachMaster(ctx, fn)
351-
nodeCount = len(slots)
358+
nodeCount = len(nodesAddresses)
352359
return nodeCount, nodeClients, nodesAddresses
353360
}
354361

0 commit comments

Comments
 (0)