improve network connectivity check
This commit is contained in:
@@ -0,0 +1 @@
|
||||
3.13
|
||||
@@ -14,11 +14,11 @@ def auth():
|
||||
# Wait for internet connectivity before proceeding
|
||||
while True:
|
||||
try:
|
||||
resp = httpx.get("https://www.google.com", timeout=5.0)
|
||||
if 200 <= resp.status_code < 400:
|
||||
test = httpx.get("https://www.google.com", timeout=5.0)
|
||||
if 200 <= test.status_code < 400:
|
||||
break
|
||||
except httpx.RequestError:
|
||||
pass
|
||||
except:
|
||||
print(test.status_code)
|
||||
print("Internet not available; retrying in 180 seconds...")
|
||||
sleep(180)
|
||||
data = {
|
||||
|
||||
Reference in New Issue
Block a user