url_ok fix

This commit is contained in:
dawoodkhan82 2021-03-01 14:39:42 -05:00
parent b9ba180bd2
commit 811c742e4b

View File

@ -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