mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-06 10:25:17 +08:00
url_ok fix
This commit is contained in:
parent
b9ba180bd2
commit
811c742e4b
@ -317,7 +317,10 @@ def setup_tunnel(local_server_port):
|
||||
|
||||
def url_ok(url):
|
||||
try:
|
||||
r = requests.head(url)
|
||||
return r.status_code == 200
|
||||
for _ in range(5):
|
||||
time.sleep(.500)
|
||||
r = requests.head(url)
|
||||
if r.status_code == 200:
|
||||
return True
|
||||
except (ConnectionError, requests.exceptions.ConnectionError):
|
||||
return False
|
||||
|
Loading…
Reference in New Issue
Block a user