Skip to content

Commit

Permalink
increase timeout on health polling request
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
sylvlecl committed Oct 4, 2024
1 parent 0df83b0 commit faf164d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/antares_web_installer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,15 @@ def start_server(self):
)
self.update_progress(50)

nb_attempts = 0
max_attempts = 300
while nb_attempts < max_attempts:
start_time = time.time()
max_wait_time = 300
nb_attempts = 1
while time.time() - start_time < max_wait_time:
logger.info(f"Waiting for server start (attempt #{nb_attempts})...")
if server_process.poll() is not None:
raise InstallError("Server failed to start, please check server logs.")
with suppress(httpx.RequestError):
res = httpx.get(SERVER_ADDRESS + "/health", timeout=1)
res = httpx.get(SERVER_ADDRESS + "/health")
if res.status_code == 200:
logger.info("The server is now running.")
break
Expand Down

0 comments on commit faf164d

Please sign in to comment.