Add 10-point flow test harness and make manual run/curate endpoints non-blocking
This commit is contained in:
9
app.py
9
app.py
@@ -3,6 +3,7 @@ from fastapi.responses import JSONResponse
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from sqlalchemy import func
|
||||
from datetime import datetime, timedelta
|
||||
import threading
|
||||
from db import init_db, SessionLocal, BotDecision, TradeExecution, CuratedInsight
|
||||
from bot import start_scheduler, run_cycle, curate_cycle
|
||||
from services import account_snapshot
|
||||
@@ -21,13 +22,13 @@ def health():
|
||||
|
||||
@app.post("/run-now")
|
||||
def run_now():
|
||||
run_cycle()
|
||||
return {"ok": True, "ran": True}
|
||||
threading.Thread(target=run_cycle, daemon=True).start()
|
||||
return {"ok": True, "queued": True, "task": "run_cycle"}
|
||||
|
||||
@app.post("/curate-now")
|
||||
def curate_now():
|
||||
curate_cycle()
|
||||
return {"ok": True, "curated": True}
|
||||
threading.Thread(target=curate_cycle, daemon=True).start()
|
||||
return {"ok": True, "queued": True, "task": "curate_cycle"}
|
||||
|
||||
@app.get("/api/account")
|
||||
def api_account():
|
||||
|
||||
Reference in New Issue
Block a user