Spaces:
Sleeping
Sleeping
Create pinger.py
Browse files
pinger.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import time
|
| 2 |
+
import requests
|
| 3 |
+
|
| 4 |
+
# Yeh URL woh hai jise aapko ping karna hai
|
| 5 |
+
URL = "https://tfqdeadlo-inddataapi.hf.space"
|
| 6 |
+
|
| 7 |
+
while True:
|
| 8 |
+
try:
|
| 9 |
+
requests.get(URL)
|
| 10 |
+
print(f"Successfully pinged {URL}")
|
| 11 |
+
except Exception as e:
|
| 12 |
+
print(f"Ping failed: {e}")
|
| 13 |
+
time.sleep(300) # 5 minute = 300 seconds
|
| 14 |
+
|