File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -746,7 +746,7 @@ def __init__(
746
746
host : str ,
747
747
port : int ,
748
748
server_type : Optional [str ] = None ,
749
- max_connections : int = 2 ** 31 ,
749
+ max_connections : int = 2 ** 31 ,
750
750
connection_class : Type [Connection ] = Connection ,
751
751
** connection_kwargs : Any ,
752
752
) -> None :
@@ -902,18 +902,16 @@ def set_nodes(
902
902
new : Dict [str , "ClusterNode" ],
903
903
remove_old : bool = False ,
904
904
) -> None :
905
- tasks = []
906
905
if remove_old :
907
- tasks = [
908
- asyncio .ensure_future (node .disconnect ())
909
- for name , node in old .items ()
910
- if name not in new
911
- ]
906
+ for name in list (old .keys ()):
907
+ if name not in new :
908
+ asyncio .ensure_future (old .pop (name ).disconnect ())
909
+
912
910
for name , node in new .items ():
913
911
if name in old :
914
912
if old [name ] is node :
915
913
continue
916
- tasks . append ( asyncio .ensure_future (old [name ].disconnect () ))
914
+ asyncio .ensure_future (old [name ].disconnect ())
917
915
old [name ] = node
918
916
919
917
def _update_moved_slots (self ) -> None :
You can’t perform that action at this time.
0 commit comments