From 0b1393ad23b9b093a5237fd7c7489844b18271c3 Mon Sep 17 00:00:00 2001 From: edgar Date: Wed, 2 Dec 2026 21:57:33 -0600 Subject: [PATCH] =?UTF-8?q?Lanzar=20la=20reconstrucci=C3=B3n=20de=20silver?= =?UTF-8?q?=20y=20gold=20por=20POST=20/runs/rebuild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapi/runs.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/webapi/runs.py b/webapi/runs.py index 916cae5..7c1fe75 100644 --- a/webapi/runs.py +++ b/webapi/runs.py @@ -15,6 +15,16 @@ def dagster() -> DagsterGraphQLClient: ) +@router.post("/rebuild") +def rebuild_gold(client: DagsterGraphQLClient = Depends(dagster)) -> dict[str, str]: + """Starts rebuilding silver and gold with the deployed code (after an upgrade, before any + new data arrives); follow it at /runs. Risk tables keep the last scores.""" + try: + return {"run_id": client.submit_job_execution("rebuild")} + except DagsterGraphQLClientError as e: + raise HTTPException(502, detail=str(e)) from e + + @router.get("/{run_id}") def run_status(run_id: str, client: DagsterGraphQLClient = Depends(dagster)) -> dict[str, str]: try: