diff --git a/backend/main.py b/backend/main.py index 008f5ed..8bb433c 100644 --- a/backend/main.py +++ b/backend/main.py @@ -3746,11 +3746,13 @@ def _enrich_build_product_info(all_products): return info -def _enrich_report_task(report_id: int): +def _enrich_report_task(report_id: int, progress_cb=None): import time db = SessionLocal() try: enrichment_progress[report_id] = {"status": "running", "step": "init", "done": 0, "total": 2} + if progress_cb: + progress_cb(95, "Sosyal kanıt verileri toplanıyor...") all_products, _ = load_report_products(db, report_id) product_ids = [p.get("id") for p in all_products if p.get("id")] product_info = _enrich_build_product_info(all_products) @@ -3778,6 +3780,8 @@ def _enrich_report_task(report_id: int): # Enrichment bitti, konsolide dosya oluştur enrichment_progress[report_id] = {"status": "running", "step": "consolidate", "done": 1, "total": 2} + if progress_cb: + progress_cb(98, "Rapor konsolide ediliyor...") try: from data_consolidator import build_consolidated_report, save_consolidated_report consolidated = build_consolidated_report(report_id, db, REPORTS_DIR, social_data=soc_payload)