File size: 459 Bytes
14e8a28 e858738 14e8a28 e858738 6a6b285 14e8a28 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
from apscheduler.schedulers.blocking import BlockingScheduler
import requests
url = "https://geek7-flk.hf.space/"
scheduler = BlockingScheduler()
def ping():
try:
response = requests.get(url)
print(f"Pinged {url}: {response.status_code}")
except Exception as e:
print(f"Error pinging {url}: {e}")
scheduler.add_job(ping, 'interval', minutes=5)
try:
scheduler.start()
except (KeyboardInterrupt, SystemExit):
pass |