Add system alerts log with nav badge and Admin Alerts tab.
Deploy / lint (push) Successful in 8s
Deploy / test (push) Failing after 1m4s
Deploy / deploy (push) Has been skipped

Persist job and ingestion warnings/errors for 7 days, surface a dismissible top-nav badge, treat stale OHLCV as a warning (e.g. ticker renames), and show market bar age on the ticker freshness chip.
This commit is contained in:
2026-07-14 13:38:04 +02:00
parent ed82d0a665
commit f59c0c3484
16 changed files with 825 additions and 7 deletions
+21 -1
View File
@@ -117,12 +117,32 @@ async def fetch_symbol(
result = await ingestion_service.fetch_and_ingest(
db, provider, symbol_upper, start_date, end_date
)
status_map = {"complete": "ok", "partial": "ok", "no_data": "warning"}
# "stale" = provider returned nothing but our last bar is old
# (rename/delist/halt) — must not look like a successful refresh.
status_map = {
"complete": "ok",
"partial": "ok",
"no_data": "warning",
"stale": "warning",
}
sources_out["ohlcv"] = {
"status": status_map.get(result.status, "error"),
"records": result.records_ingested,
"message": result.message,
"last_date": result.last_date.isoformat() if result.last_date else None,
}
if result.status in ("stale", "no_data", "error"):
from app.services.system_event_service import log_event
await log_event(
db,
severity="warning" if result.status != "error" else "error",
source="ingestion",
code=f"ohlcv_{result.status}",
message=result.message or f"OHLCV fetch {result.status} for {symbol_upper}",
symbol=symbol_upper,
dedup_key=f"ohlcv_{result.status}:{symbol_upper}",
)
except Exception as exc:
logger.error("OHLCV fetch failed for %s: %s", symbol_upper, exc)
sources_out["ohlcv"] = {"status": "error", "records": 0, "message": str(exc)}