mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-04 00:56:23 +02:00
Wait until the webui backend responds with a 200 OK to ping requests
This commit is contained in:
parent
6f4e2017f4
commit
9abc76482c
@ -68,7 +68,10 @@ def ping(timeout=1):
|
|||||||
global webui_opts
|
global webui_opts
|
||||||
|
|
||||||
try:
|
try:
|
||||||
webui_get("/internal/ping", timeout=timeout)
|
res = webui_get("/internal/ping", timeout=timeout)
|
||||||
|
|
||||||
|
if res.status_code != 200:
|
||||||
|
raise ConnectTimeout(res.text)
|
||||||
|
|
||||||
if webui_opts is None:
|
if webui_opts is None:
|
||||||
try:
|
try:
|
||||||
@ -85,7 +88,7 @@ def ping(timeout=1):
|
|||||||
|
|
||||||
webui_opts = res.json()
|
webui_opts = res.json()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error setting options: {e}")
|
print(f"Error getting options: {e}")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
except ConnectTimeout as e:
|
except ConnectTimeout as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user