fix: analyst ratings timeout + add accession column to institution_filings

- Add 6s server-side timeout to Yahoo Finance quoteSummary (Promise.race) so the backend responds with stale data instead of hanging indefinitely. Stale cache is served on error (router.ts:1895-1898), matching ADR-0009.
- Hoist YahooFinance to a module-level singleton (getYf()) so the crumb/cookie is fetched once, not per call. Matches YFinanceAdapter pattern.
- Add suppressNotices for yahooSurvey to reduce log noise.
- Add accession column to institution_filings (schema.sql + migration in client.ts) and thread it through both secDataFetcher.ts INSERT paths (13D/G and 13F-HR). Fixes recurring `no such column: accession` error in new13daProducer alert tick.
- new13daProducer.ts needs no changes - its SELECT accession query now works.
This commit is contained in:
Investor Flow Build
2026-07-25 11:52:48 -04:00
parent 8b51d16d7b
commit 351c104eba
4 changed files with 29 additions and 15 deletions
+2 -1
View File
@@ -113,7 +113,8 @@ CREATE TABLE IF NOT EXISTS institution_filings (
shares REAL, -- shares reported
value_usd REAL,
reported_quarter TEXT NOT NULL, -- calendar quarter positions are "as of"
filed_at TEXT NOT NULL,
filed_at TEXT NOT NULL, -- when the filing was submitted to SEC
accession TEXT, -- SEC accession number (enables 13D/G dedup)
fetched_at TEXT NOT NULL,
put_call TEXT -- Put|Call|null for common stock (13F only)
);