feat: macro series

This commit is contained in:
OpenSquared
2026-06-30 19:08:33 +02:00
parent b8a1d2ad07
commit bb614936c3
5 changed files with 417 additions and 91 deletions

View File

@@ -47,6 +47,17 @@ def calendar_sync(weeks_ahead: int = 8) -> Dict[str, Any]:
result = {"error": str(e)}
source = "error"
# After calendar upsert, log any forecast/actual changes to macro_series_log
try:
from services.database import get_conn
from services.macro_series_log import scan_and_log_all
_conn = get_conn()
log_result = scan_and_log_all(_conn, source=source)
_conn.close()
result["_log"] = log_result
except Exception as e:
logger.warning(f"[calendar_sync] macro_series_log scan failed: {e}")
_sync_status["running"] = False
_sync_status["last_result"] = result
_sync_status["source"] = source