Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower timeout for SD check on startup #1562

Merged
merged 3 commits into from
Feb 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions backend/src/nodes/impl/external_stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ class ExternalServiceTimeout(Exception):
pass


def get(url) -> Dict:
def get(url, timeout: float = STABLE_DIFFUSION_REQUEST_TIMEOUT) -> Dict:
try:
response = requests.get(url, timeout=STABLE_DIFFUSION_REQUEST_TIMEOUT)
response = requests.get(url, timeout=timeout)
except requests.ConnectionError as exc:
raise ExternalServiceConnectionError(ERROR_MSG) from exc
except requests.exceptions.ReadTimeout as exc:
Expand Down Expand Up @@ -96,7 +96,7 @@ def verify_api_connection():
global has_api_connection # pylint: disable=global-statement
if has_api_connection is None:
has_api_connection = False
get(STABLE_DIFFUSION_OPTIONS_URL)
get(STABLE_DIFFUSION_OPTIONS_URL, timeout=0.5)
has_api_connection = True

if not has_api_connection:
Expand Down