INNER CODE UNIT · Python
_run_enrichment_background
Nuclear-Marmalade/dataforge · forge/dashboard/app.py:234
def _run_enrichment_background(mode: str, workers: int):
"""Background thread that runs the enrichment pipeline."""
db, total = _init_enrichment(mode, workers)
if not db:
with _enrichment_lock:
_enrichment_stats["running"] = False
return
try:
_run_enrichment_loop(db, mode, workers, total)
except ImportError as e:
_append_log(f"Pipeline dependencies not available: {e}")
_append_log("Install dependencies: pip install aiohttp psycopg2-binary")
except Exception as e:
_append_log(f"ERROR: {e}")
logger.exception("Enrichment failed")
finally:
with _enrichment_lock: