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
|
# Wait for internet connectivity before proceeding
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
resp = httpx.get("https://www.google.com", timeout=5.0)
|
test = httpx.get("https://www.google.com", timeout=5.0)
|
||||||
if 200 <= resp.status_code < 400:
|
if 200 <= test.status_code < 400:
|
||||||
break
|
break
|
||||||
except httpx.RequestError:
|
except:
|
||||||
pass
|
print(test.status_code)
|
||||||
print("Internet not available; retrying in 180 seconds...")
|
print("Internet not available; retrying in 180 seconds...")
|
||||||
sleep(180)
|
sleep(180)
|
||||||
data = {
|
data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user