Skip to content

Commit 3542c61

Browse files
committed
Applying copilot's review comments
1 parent 1c43625 commit 3542c61

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

redis/asyncio/cluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,8 @@ async def initialize(self) -> None:
13131313
startup_nodes_reachable = False
13141314
fully_covered = False
13151315
exception = None
1316+
# Convert to tuple to prevent RuntimeError if self.startup_nodes
1317+
# is modified during iteration
13161318
for startup_node in tuple(self.startup_nodes.values()):
13171319
try:
13181320
# Make sure cluster mode is enabled on this node

redis/cluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,8 @@ def initialize(self):
16741674
fully_covered = False
16751675
kwargs = self.connection_kwargs
16761676
exception = None
1677+
# Convert to tuple to prevent RuntimeError if self.startup_nodes
1678+
# is modified during iteration
16771679
for startup_node in tuple(self.startup_nodes.values()):
16781680
try:
16791681
if startup_node.redis_connection:

0 commit comments

Comments
 (0)