@@ -1546,24 +1546,24 @@ def initialize(self):
1546
1546
# add this node to the nodes cache
1547
1547
tmp_nodes_cache [target_node .name ] = target_node
1548
1548
1549
+ target_replica_nodes = []
1550
+ for replica_node in slot [3 :]:
1551
+ host = str_if_bytes (replica_node [0 ])
1552
+ port = int (replica_node [1 ])
1553
+
1554
+ target_replica_node = self ._get_or_create_cluster_node (
1555
+ host , port , REPLICA , tmp_nodes_cache
1556
+ )
1557
+ target_replica_nodes .append (target_replica_node )
1558
+ # add this node to the nodes cache
1559
+ tmp_nodes_cache [target_replica_node .name ] = target_replica_node
1560
+
1549
1561
for i in range (int (slot [0 ]), int (slot [1 ]) + 1 ):
1550
1562
if i not in tmp_slots :
1551
1563
tmp_slots [i ] = []
1552
1564
tmp_slots [i ].append (target_node )
1553
- replica_nodes = [slot [j ] for j in range (3 , len (slot ))]
1554
-
1555
- for replica_node in replica_nodes :
1556
- host = str_if_bytes (replica_node [0 ])
1557
- port = replica_node [1 ]
1558
-
1559
- target_replica_node = self ._get_or_create_cluster_node (
1560
- host , port , REPLICA , tmp_nodes_cache
1561
- )
1565
+ for target_replica_node in target_replica_nodes :
1562
1566
tmp_slots [i ].append (target_replica_node )
1563
- # add this node to the nodes cache
1564
- tmp_nodes_cache [
1565
- target_replica_node .name
1566
- ] = target_replica_node
1567
1567
else :
1568
1568
# Validate that 2 nodes want to use the same slot cache
1569
1569
# setup
0 commit comments