fix(health): raise maxStaleMin on 10-min seed keys to stop flapping (#1865)

* fix(health): raise maxStaleMin on 10-min seed keys + fix positiveGeoEvents key

Keys seeded every ~10 min had maxStaleMin:15 (1.5x margin), causing false
STALE_SEED flapping on any slight writer delay. Rule applied: 3x interval.

riskScores:             15 -> 30  (CII warm-ping every 8 min)
militaryFlights:        15 -> 30  (cron ~10 min, LIVE_TTL=600s)
militaryForecastInputs: 15 -> 30  (same cron as militaryFlights)
chokepointTransits:     15 -> 30  (relay loop every 10 min)
transitSummaries:       15 -> 30  (relay loop every 10 min)

Also: fix positiveGeoEvents Redis key typo (positive_events -> positive-events).
Health was monitoring the wrong key entirely.

* fix(health): revert positiveGeoEvents key to underscore (producer uses positive_events)
This commit is contained in:
Elie Habib
2026-03-19 10:44:35 +04:00
committed by GitHub
parent 43d591421d
commit 05993b4fe8

View File

@@ -107,11 +107,11 @@ const SEED_META = {
giving: { key: 'seed-meta:giving:summary', maxStaleMin: 10080 },
gpsjam: { key: 'seed-meta:intelligence:gpsjam', maxStaleMin: 720 },
positiveGeoEvents:{ key: 'seed-meta:positive-events:geo', maxStaleMin: 60 },
riskScores: { key: 'seed-meta:intelligence:risk-scores', maxStaleMin: 15 },
riskScores: { key: 'seed-meta:intelligence:risk-scores', maxStaleMin: 30 }, // CII warm-ping every 8min; 30min = ~3.5x interval,
iranEvents: { key: 'seed-meta:conflict:iran-events', maxStaleMin: 10080 },
ucdpEvents: { key: 'seed-meta:conflict:ucdp-events', maxStaleMin: 420 },
militaryFlights: { key: 'seed-meta:military:flights', maxStaleMin: 15 },
militaryForecastInputs: { key: 'seed-meta:military-forecast-inputs', maxStaleMin: 15 },
militaryFlights: { key: 'seed-meta:military:flights', maxStaleMin: 30 }, // cron ~10min (LIVE_TTL=600s); 30min = 3x interval,
militaryForecastInputs: { key: 'seed-meta:military-forecast-inputs', maxStaleMin: 30 }, // same cron as militaryFlights,
satellites: { key: 'seed-meta:intelligence:satellites', maxStaleMin: 180 },
weatherAlerts: { key: 'seed-meta:weather:alerts', maxStaleMin: 30 },
spending: { key: 'seed-meta:economic:spending', maxStaleMin: 120 },
@@ -128,8 +128,8 @@ const SEED_META = {
correlationCards: { key: 'seed-meta:correlation:cards', maxStaleMin: 15 },
portwatch: { key: 'seed-meta:supply_chain:portwatch', maxStaleMin: 720 },
corridorrisk: { key: 'seed-meta:supply_chain:corridorrisk', maxStaleMin: 120 },
chokepointTransits: { key: 'seed-meta:supply_chain:chokepoint_transits', maxStaleMin: 15 },
transitSummaries: { key: 'seed-meta:supply_chain:transit-summaries', maxStaleMin: 15 },
chokepointTransits: { key: 'seed-meta:supply_chain:chokepoint_transits', maxStaleMin: 30 }, // relay every 10min; 30min = 3x interval,
transitSummaries: { key: 'seed-meta:supply_chain:transit-summaries', maxStaleMin: 30 }, // relay every 10min; 30min = 3x interval,
usniFleet: { key: 'seed-meta:military:usni-fleet', maxStaleMin: 480 },
securityAdvisories: { key: 'seed-meta:intelligence:advisories', maxStaleMin: 120 },
customsRevenue: { key: 'seed-meta:trade:customs-revenue', maxStaleMin: 1440 },