INNER CODE UNIT · Python
api_enrich_stop
Nuclear-Marmalade/dataforge · forge/dashboard/app.py:510
async def api_enrich_stop():
"""Signal enrichment to stop."""
_enrichment_stop.set()
return HTMLResponse(
'<div class="forge-card text-amber-400 text-center py-3">'
"Stop signal sent. Enrichment will finish current batch and stop.</div>"
)
@app.get("/api/enrich/status")
async def api_enrich_status():
"""Return enrichment status as JSON (polled by HTMX every 3s)."""
with _enrichment_lock:
stats_copy = dict(_enrichment_stats)
return JSONResponse({"stats": stats_copy})
MAX_UPLOAD_SIZE = 100 * 1024 * 1024 # 100 MB