From 64f13176f60285bc447fe8023b11f070a9c0ed11 Mon Sep 17 00:00:00 2001 From: Jakub Kuderski Date: Wed, 5 Mar 2025 02:25:01 -0500 Subject: [PATCH] [sd] Fix simple client port check (#1036) --- shortfin/python/shortfin_apps/sd/simple_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shortfin/python/shortfin_apps/sd/simple_client.py b/shortfin/python/shortfin_apps/sd/simple_client.py index 46b204067..0ad8b839f 100644 --- a/shortfin/python/shortfin_apps/sd/simple_client.py +++ b/shortfin/python/shortfin_apps/sd/simple_client.py @@ -177,7 +177,7 @@ async def async_range(count): await asyncio.sleep(0.0) -def is_connected(host, port): +def is_connected(host: str, port: int) -> bool: max_port = 65535 if port < 1 or port > max_port: print( @@ -193,7 +193,7 @@ def is_connected(host, port): if requests.get(f"{url}/health", timeout=20).status_code == 200: print("Successfully connected to server.") ready = True - return + break time.sleep(2) print(".", end=None) except: