INNER CODE UNIT · Python

_init_enrichment

Nuclear-Marmalade/dataforge · forge/dashboard/app.py:167

def _init_enrichment(mode: str, workers: int) -> tuple:
    """Initialize enrichment state and return (db, total) or (None, 0) on error."""
    global _enrichment_stats
    _append_log(f"Starting enrichment: mode={mode}, workers={workers}")

    with _enrichment_lock:
        _enrichment_stats["started_at"] = time.time()
        _enrichment_stats["total_processed"] = 0
        _enrichment_stats["emails_found"] = 0
        _enrichment_stats["tech_stacks_found"] = 0

    db = _get_db()
    if not db:
        _append_log("ERROR: Database not available")
        return None, 0

    total = db.count()
    _append_log(f"Total records in database: {total:,}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…