INNER CODE UNIT · Python
portfolio_refresh
simonlin1212/vibe-astock · vr/app.py:232
def portfolio_refresh():
"""手动刷新:立即重拉行情算盈亏。"""
try:
return {"data": pf.get_portfolio()}
except Exception as e: # noqa: BLE001
raise HTTPException(502, f"刷新失败:{e}") from e
@app.get("/api/radar")
def radar():
"""资讯雷达:12 赛道公开 RSS 资讯(读缓存,无缓存返回赛道骨架)。"""
try:
return {"data": newsradar.get_radar(force=False)}
except Exception as e: # noqa: BLE001
raise HTTPException(502, f"资讯雷达异常:{e}") from e
@app.post("/api/radar/refresh")