Spaces:
Running
Running
Sync from GitHub (tests passed)
Browse files- worker/tasks.py +3 -4
worker/tasks.py
CHANGED
|
@@ -494,11 +494,10 @@ async def _execute_pipeline_stages_v2(
|
|
| 494 |
if result.get("snapshot_generated") and snapshot_report:
|
| 495 |
logger.info(f"[run_id={run_id}] Stage 6: Generate commentary")
|
| 496 |
try:
|
| 497 |
-
import asyncio
|
| 498 |
from app.commentary import generate_and_save_commentary
|
| 499 |
|
| 500 |
-
# Extract required fields from snapshot
|
| 501 |
-
|
| 502 |
session=session,
|
| 503 |
symbol="HG=F",
|
| 504 |
current_price=snapshot_report.get("current_price", 0.0),
|
|
@@ -508,7 +507,7 @@ async def _execute_pipeline_stages_v2(
|
|
| 508 |
sentiment_label=snapshot_report.get("sentiment_label", "Neutral"),
|
| 509 |
top_influencers=snapshot_report.get("top_influencers", []),
|
| 510 |
news_count=snapshot_report.get("data_quality", {}).get("news_count_7d", 0),
|
| 511 |
-
)
|
| 512 |
session.commit()
|
| 513 |
|
| 514 |
result["commentary_generated"] = True
|
|
|
|
| 494 |
if result.get("snapshot_generated") and snapshot_report:
|
| 495 |
logger.info(f"[run_id={run_id}] Stage 6: Generate commentary")
|
| 496 |
try:
|
|
|
|
| 497 |
from app.commentary import generate_and_save_commentary
|
| 498 |
|
| 499 |
+
# Extract required fields from snapshot and await async call
|
| 500 |
+
await generate_and_save_commentary(
|
| 501 |
session=session,
|
| 502 |
symbol="HG=F",
|
| 503 |
current_price=snapshot_report.get("current_price", 0.0),
|
|
|
|
| 507 |
sentiment_label=snapshot_report.get("sentiment_label", "Neutral"),
|
| 508 |
top_influencers=snapshot_report.get("top_influencers", []),
|
| 509 |
news_count=snapshot_report.get("data_quality", {}).get("news_count_7d", 0),
|
| 510 |
+
)
|
| 511 |
session.commit()
|
| 512 |
|
| 513 |
result["commentary_generated"] = True
|