feat: wait for internet using httpx before continuing auth

Co-authored-by: aider (openai/gpt-5) <aider@aider.chat>
This commit is contained in:
Mark Eaton
2025-11-18 09:30:30 -05:00
co-authored by aider
parent 56ca698031
commit d640ba26a9
+9
View File
@@ -11,6 +11,15 @@ load_dotenv()
def auth(): 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:
break
except httpx.RequestError:
pass
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"],