File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -525,17 +525,16 @@ def on_reconnect():
525525 # Shut down servers one by one (shut down the server we're connected to)
526526 for i in range (len (cluster .servers ) - 1 ): # Keep last server running
527527 # Find which server the client is currently connected to using server_info
528- connected_host = client .server_info .host
529528 connected_port = client .server_info .port
530529
531- # Find the matching server in the cluster
530+ # Find the matching server in the cluster by port
532531 server_to_shutdown = None
533532 for server in cluster .servers :
534- if server .host == connected_host and server . port == connected_port :
533+ if server .port == connected_port :
535534 server_to_shutdown = server
536535 break
537536
538- assert server_to_shutdown is not None , f"Could not find server for { connected_host } : { connected_port } "
537+ assert server_to_shutdown is not None , f"Could not find server for port { connected_port } "
539538
540539 # Shutdown the connected server
541540 await server_to_shutdown .shutdown ()
You can’t perform that action at this time.
0 commit comments