fix: httpx timeouts cause gradio to fail during launch (#8962)

* fix: httpx timeouts cause gradio to fail during launch

This has been fixed in https://github.com/gradio-app/gradio/pull/7707, but it seems it has been reintroduced during some other code changes/refactoring.

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Remigiusz Samborski 2024-08-01 16:47:19 +02:00 committed by GitHub
parent d072252156
commit c68eefba6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:fix: httpx timeouts cause gradio to fail during launch

View File

@ -55,6 +55,6 @@ def url_ok(url: str) -> bool:
if r.status_code in (200, 401, 302): # 401 or 302 if auth is set
return True
time.sleep(0.500)
except (ConnectionError, httpx.ConnectError):
except (ConnectionError, httpx.ConnectError, httpx.TimeoutException):
return False
return False