Skip to content
Snippets Groups Projects
Commit 86505182 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Added retry mechanism to status confirmation, to address suspect timeout problem

(cherry picked from commit 7b1c2aff)
parent 1e990887
No related branches found
No related tags found
No related merge requests found
import argparse
from multiprocessing import Process
import requests
from requests.adapters import HTTPAdapter
from urllib3 import Retry
import uvicorn
import webbrowser
......@@ -47,7 +49,13 @@ def main(args) -> None:
server_process.start()
try:
resp = requests.get(url)
sesh = requests.Session()
retries = Retry(
total=5,
backoff_factor=0.1,
)
sesh.mount('http://', HTTPAdapter(max_retries=retries))
resp = sesh.get(url)
assert resp.status_code == 200
except Exception:
print('Error starting server')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment