update sleep times; remove line causing secondary error
This commit is contained in:
@@ -12,15 +12,15 @@ load_dotenv()
|
|||||||
|
|
||||||
def auth():
|
def auth():
|
||||||
# Wait for internet connectivity before proceeding
|
# Wait for internet connectivity before proceeding
|
||||||
|
sleep(180)
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
test = httpx.get("https://www.google.com", timeout=5.0)
|
test = httpx.get("https://www.google.com", timeout=5.0)
|
||||||
if 200 <= test.status_code < 400:
|
if 200 <= test.status_code < 400:
|
||||||
break
|
break
|
||||||
except:
|
except httpcore.ConnectError:
|
||||||
print(test.status_code)
|
print("Internet not available; retrying in 600 seconds...")
|
||||||
print("Internet not available; retrying in 180 seconds...")
|
sleep(600)
|
||||||
sleep(180)
|
|
||||||
data = {
|
data = {
|
||||||
"client_id": os.environ["CLIENT_ID"],
|
"client_id": os.environ["CLIENT_ID"],
|
||||||
"client_secret": os.environ["CLIENT_SECRET"],
|
"client_secret": os.environ["CLIENT_SECRET"],
|
||||||
|
|||||||
Reference in New Issue
Block a user