network connectivity check moved to .service file; deleted here
This commit is contained in:
@@ -11,16 +11,6 @@ load_dotenv()
|
||||
|
||||
|
||||
def auth():
|
||||
# Wait for internet connectivity before proceeding
|
||||
sleep(180)
|
||||
while True:
|
||||
try:
|
||||
test = httpx.get("https://www.google.com", timeout=5.0)
|
||||
if 200 <= test.status_code < 400:
|
||||
break
|
||||
except httpcore.ConnectError:
|
||||
print("Internet not available; retrying in 600 seconds...")
|
||||
sleep(600)
|
||||
data = {
|
||||
"client_id": os.environ["CLIENT_ID"],
|
||||
"client_secret": os.environ["CLIENT_SECRET"],
|
||||
@@ -64,7 +54,7 @@ def main(token):
|
||||
|
||||
|
||||
def send(card):
|
||||
resp = httpx.post(os.environ["TEAMS_URL"], json=card)
|
||||
resp = httpx.post(os.environ["TEAMS_URL"], json=card, timeout=None)
|
||||
resp.raise_for_status()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user