Skip to content

Update main.py#2

Open
yaddisidhu90 wants to merge 1 commit intoByteSupreme:mainfrom
yaddisidhu90:patch-2
Open

Update main.py#2
yaddisidhu90 wants to merge 1 commit intoByteSupreme:mainfrom
yaddisidhu90:patch-2

Conversation

@yaddisidhu90
Copy link

import requests
import time
import os
from dotenv import load_dotenv

Load .env variables

load_dotenv()

url = os.getenv("PING_URL")
interval = int(os.getenv("PING_INTERVAL", 20))

while True:
try:
response = requests.get(url)
print("Status Code:", response.status_code)
except requests.exceptions.RequestException as e:
print("An error occurred:", e)

time.sleep(interval)

@yaddisidhu90
Copy link
Author

import requests
import time
import os
from dotenv import load_dotenv

Load .env variables

load_dotenv()

url = os.getenv("PING_URL")
interval = int(os.getenv("PING_INTERVAL", 20))

while True:
try:
response = requests.get(url)
print("Status Code:", response.status_code)
except requests.exceptions.RequestException as e:
print("An error occurred:", e)

time.sleep(interval)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant