File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 2727import secrets
2828import time
2929import urllib .parse
30+ import requests
31+ import requests .adapters
32+ import logging
3033import typing
3134import scipy .spatial .transform
32- import httpx
3335
3436from espressomd .plugins import ase
3537
@@ -250,13 +252,20 @@ def __init__(self,
250252
251253 # Check that the server is up
252254 max_wait_iterations = 60
255+ previous_logging_level = logging .root .manager .disable
253256 while True :
254257 try :
255- r = httpx .get (f"{ self .url } :{ self .SERVER_PORT } /health" )
256- if r .status_code == 200 :
258+ logging .disable (logging .WARNING )
259+ session = requests .Session ()
260+ adapter = requests .adapters .HTTPAdapter (max_retries = 1 )
261+ req = session .mount (f"{ self .url } :{ self .SERVER_PORT } " , adapter )
262+ req = session .get (f"{ self .url } :{ self .SERVER_PORT } /health" )
263+ if req .status_code == 200 :
264+ logging .disable (previous_logging_level )
257265 break
258- except httpx . RequestError :
266+ except Exception :
259267 pass
268+ logging .disable (previous_logging_level )
260269 time .sleep (0.5 )
261270 max_wait_iterations -= 1
262271 if max_wait_iterations == 0 :
You can’t perform that action at this time.
0 commit comments