alesamodio commited on
Commit
e5cae6b
·
1 Parent(s): b1e2dca
Files changed (1) hide show
  1. app.py +6 -7
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 ping_receiver():
14
- """Ping the receiver Space once to wake it up."""
 
15
  try:
16
  r = requests.get(DB3_URL, timeout=10)
17
- return {
18
- "status": "ok",
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)}