mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-06-01 23:56:41 +02:00
Increase the webui health-check timeout to 30 seconds (from 1 second); Also trap ReadTimeout in the collection of TimeoutError
This commit is contained in:
parent
459bfd4280
commit
d4ea34a013
@ -126,7 +126,7 @@ def start_backend():
|
|||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
impl.ping(timeout=1)
|
impl.ping(timeout=30)
|
||||||
|
|
||||||
is_first_start = not has_started
|
is_first_start = not has_started
|
||||||
has_started = True
|
has_started = True
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import requests
|
import requests
|
||||||
from requests.exceptions import ConnectTimeout, ConnectionError
|
from requests.exceptions import ConnectTimeout, ConnectionError, ReadTimeout
|
||||||
from typing import Union, List
|
from typing import Union, List
|
||||||
from threading import local as Context
|
from threading import local as Context
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
@ -8,7 +8,7 @@ import uuid
|
|||||||
import time
|
import time
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
||||||
from sdkit.utils import base64_str_to_img, img_to_base64_str
|
from sdkit.utils import base64_str_to_img, img_to_base64_str, log
|
||||||
|
|
||||||
WEBUI_HOST = "localhost"
|
WEBUI_HOST = "localhost"
|
||||||
WEBUI_PORT = "7860"
|
WEBUI_PORT = "7860"
|
||||||
@ -91,7 +91,7 @@ def ping(timeout=1):
|
|||||||
print(f"Error getting options: {e}")
|
print(f"Error getting options: {e}")
|
||||||
|
|
||||||
return True
|
return True
|
||||||
except (ConnectTimeout, ConnectionError) as e:
|
except (ConnectTimeout, ConnectionError, ReadTimeout) as e:
|
||||||
raise TimeoutError(e)
|
raise TimeoutError(e)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user