Spaces:
Running
Running
Commit ·
e5cae6b
1
Parent(s): b1e2dca
test 2
Browse files
app.py
CHANGED
|
@@ -10,14 +10,13 @@ def home():
|
|
| 10 |
return {"status": "running", "message": "Minimal ping trigger alive"}
|
| 11 |
|
| 12 |
@app.get("/ping")
|
| 13 |
-
def
|
| 14 |
-
|
|
|
|
| 15 |
try:
|
| 16 |
r = requests.get(DB3_URL, timeout=10)
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
"code": r.status_code,
|
| 20 |
-
"response": r.text[:200]
|
| 21 |
-
}
|
| 22 |
except Exception as e:
|
|
|
|
| 23 |
return {"status": "error", "error": str(e)}
|
|
|
|
| 10 |
return {"status": "running", "message": "Minimal ping trigger alive"}
|
| 11 |
|
| 12 |
@app.get("/ping")
|
| 13 |
+
def run_trigger():
|
| 14 |
+
import requests
|
| 15 |
+
DB3_URL = "https://alesamodio-db3-update.hf.space"
|
| 16 |
try:
|
| 17 |
r = requests.get(DB3_URL, timeout=10)
|
| 18 |
+
print(f"🌤️ Pinged receiver, status {r.status_code}")
|
| 19 |
+
return {"status": "ok", "response": r.text[:200]}
|
|
|
|
|
|
|
|
|
|
| 20 |
except Exception as e:
|
| 21 |
+
print(f"❌ Error pinging receiver: {e}")
|
| 22 |
return {"status": "error", "error": str(e)}
|