Align branding, prompts, and deployment tooling

This commit is contained in:
2026-03-28 22:16:56 +08:00
parent 4aa69650e8
commit 4295293a21
90 changed files with 1320 additions and 2044 deletions

View File

@@ -244,6 +244,20 @@ class MarketStore:
"last_news_fetch": None,
}
def get_latest_news_date(self, symbol: str) -> str | None:
"""Return the latest stored published news date for one ticker."""
with self._connect() as conn:
row = conn.execute(
"""
SELECT MAX(substr(nr.published_utc, 1, 10)) AS latest_date
FROM news_ticker nt
JOIN news_raw nr ON nr.id = nt.news_id
WHERE nt.symbol = ?
""",
(symbol,),
).fetchone()
return str(row["latest_date"]).strip() if row and row["latest_date"] else None
def upsert_ohlc(self, symbol: str, rows: Iterable[dict[str, Any]], *, source: str = "polygon") -> int:
timestamp = _utc_timestamp()
count = 0