improve network connectivity check

This commit is contained in:
Mark Eaton
2025-11-18 09:39:13 -05:00
parent d640ba26a9
commit a93a8b5fc8
2 changed files with 6 additions and 5 deletions
+1
View File
@@ -0,0 +1 @@
3.13
+5 -5
View File
@@ -14,12 +14,12 @@ 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 = {
"client_id": os.environ["CLIENT_ID"], "client_id": os.environ["CLIENT_ID"],