fix(lotto): Phase 3 리뷰 반영 (run-forward 백그라운드·review 404·track_record distinct·테스트 보강)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,12 +16,21 @@ def calibration(weeks: int = Query(52, ge=1, le=520)):
|
||||
|
||||
@router.get("/review/{draw_no}")
|
||||
def review(draw_no: int):
|
||||
if db.get_draw(draw_no) is None:
|
||||
from fastapi import HTTPException
|
||||
raise HTTPException(404, f"no draw {draw_no}")
|
||||
return backtest.build_review_payload(draw_no)
|
||||
|
||||
|
||||
@router.post("/run-forward")
|
||||
def run_forward(draw_no: int = Query(...), k: int = 5000, pool_n: int = 20000):
|
||||
return backtest.run_forward_purchase(draw_no=draw_no, k=k, pool_n=pool_n)
|
||||
def run_forward(
|
||||
background_tasks: BackgroundTasks,
|
||||
draw_no: int = Query(...),
|
||||
k: int = Query(5000, ge=1, le=5000),
|
||||
pool_n: int = Query(20000, ge=1000, le=20000),
|
||||
):
|
||||
background_tasks.add_task(backtest.run_forward_purchase, draw_no, k, pool_n)
|
||||
return {"ok": True, "queued": True, "draw_no": draw_no}
|
||||
|
||||
|
||||
@router.post("/backfill")
|
||||
|
||||
Reference in New Issue
Block a user