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__(
746746 host : str ,
747747 port : int ,
748748 server_type : Optional [str ] =  None ,
749-  max_connections : int  =  2   **   31 ,
749+  max_connections : int  =  2 ** 31 ,
750750 connection_class : Type [Connection ] =  Connection ,
751751 ** connection_kwargs : Any ,
752752 ) ->  None :
@@ -902,18 +902,16 @@ def set_nodes(
902902 new : Dict [str , "ClusterNode" ],
903903 remove_old : bool  =  False ,
904904 ) ->  None :
905-  tasks  =  []
906905 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+ 
912910 for  name , node  in  new .items ():
913911 if  name  in  old :
914912 if  old [name ] is  node :
915913 continue 
916-  tasks . append ( asyncio .ensure_future (old [name ].disconnect () ))
914+  asyncio .ensure_future (old [name ].disconnect ())
917915 old [name ] =  node 
918916
919917 def  _update_moved_slots (self ) ->  None :
                         You can’t perform that action at this time. 
           
                  
0 commit comments