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

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

parent 5b13c794
No related branches found
No related tags found
No related merge requests found
......@@ -10,10 +10,9 @@ model_server implement image analysis jobs for online use (e.g. in feedback micr
`cd %userprofile%`<br>
`git clone https://almf-staff:KJmFvyPRbpzoVZDqfMzV@git.embl.de/rhodes/model_server.git`
5. Open the newly created project root: `cd model_server`
6. Create the environment: `mamba create -n model_server_env --override-channels -c pytorch -c ilastik-forge -c conda-forge ilastik`
7. In the same terminal, run: `mamba init`
8. Now close and re-open the terminal: `Miniforge3 > Miniforge Prompt`
9. Now activate the environment: `mamba activate model_server_env`
6. Create the environment: `mamba env create --file requirements.yml --name model_server_env`
7. Activate the environment: `mamba activate model_server_env`
8.
# Examples
......
import argparse
from multiprocessing import Process
import requests
from requests.adapters import HTTPAdapter
from urllib3 import Retry
import uvicorn
import webbrowser
......@@ -48,7 +50,13 @@ if __name__ == '__main__':
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