From 6efd3fd116d4b002417dfc26ff65306d20185778 Mon Sep 17 00:00:00 2001 From: gsd Date: Thu, 7 Dec 2023 18:24:43 +0300 Subject: [PATCH] docker features 3 --- ext/python-docker-client/dockerclient.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/python-docker-client/dockerclient.py b/ext/python-docker-client/dockerclient.py index 7c6082d..1ad4b52 100644 --- a/ext/python-docker-client/dockerclient.py +++ b/ext/python-docker-client/dockerclient.py @@ -113,14 +113,16 @@ if __name__ == "__main__": while try_count: try_count -= 1 + if try_count == 0: + print("Exit cannot get backend") + sys.exit(1) + loop.run_until_complete(c.request_srvs()) if c.servers.__len__() == 0: print("Backend not respond, or server list not setup! Try again after 5 seconds...") loop.run_until_complete(asyncio.sleep(5)) - - if try_count == 0: - print("Exit cannot get backend") - sys.exit(1) + else: + break print(f"Found {c.servers.__len__()} servers!")