Spaces:
Running
Running
Commit ·
cdf6be8
1
Parent(s): 9595689
update link with db3 update
Browse files
app.py
CHANGED
|
@@ -37,8 +37,9 @@ def trigger_db3():
|
|
| 37 |
for attempt in range(1, 41): # ≈ 20 min total (30 s × 40)
|
| 38 |
try:
|
| 39 |
# 1️⃣ check if Db3_update responds
|
| 40 |
-
|
| 41 |
-
|
|
|
|
| 42 |
log.append(f"✅ Attempt {attempt}: space ready, calling /run")
|
| 43 |
run_url = f"{DB3_URL}/run?secret={SECRET}"
|
| 44 |
run_resp = requests.get(run_url, timeout=120)
|
|
|
|
| 37 |
for attempt in range(1, 41): # ≈ 20 min total (30 s × 40)
|
| 38 |
try:
|
| 39 |
# 1️⃣ check if Db3_update responds
|
| 40 |
+
READY_URL = f"{DB3_URL}/ready"
|
| 41 |
+
r = requests.get(READY_URL, timeout=15)
|
| 42 |
+
if r.status_code == 200 and '"ready"' in r.text:
|
| 43 |
log.append(f"✅ Attempt {attempt}: space ready, calling /run")
|
| 44 |
run_url = f"{DB3_URL}/run?secret={SECRET}"
|
| 45 |
run_resp = requests.get(run_url, timeout=120)
|