Skip to content

Commit b585dea

Browse files
authored
fix(health): fix bisPolicy stale threshold + move serviceStatuses to on-demand (koala73#1783)
bisPolicy/bisExchange/bisCredit: maxStaleMin 2880 (2d) -> 10080 (7d) to match BIS data's weekly update frequency. Was reporting STALE_SEED after 2 days even though BIS data updates weekly. serviceStatuses: moved from SEED_META back to ON_DEMAND_KEYS. It's RPC-populated (no dedicated seed), seed-meta only written on fresh fetch. Goes stale between user visits, causing false STALE_SEED alerts.
1 parent cf48144 commit b585dea

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

api/health.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ const SEED_META = {
9494
marketQuotes: { key: 'seed-meta:market:stocks', maxStaleMin: 30 },
9595
commodityQuotes: { key: 'seed-meta:market:commodities', maxStaleMin: 30 },
9696
// RPC/warm-ping keys — seed-meta written by relay loops or handlers
97-
serviceStatuses: { key: 'seed-meta:infra:service-statuses', maxStaleMin: 30 },
97+
// serviceStatuses: moved to ON_DEMAND — RPC-populated, no dedicated seed, goes stale when no users visit
9898
cableHealth: { key: 'seed-meta:cable-health', maxStaleMin: 60 },
9999
macroSignals: { key: 'seed-meta:economic:macro-signals', maxStaleMin: 60 },
100-
bisPolicy: { key: 'seed-meta:economic:bis:policy', maxStaleMin: 2880 },
101-
bisExchange: { key: 'seed-meta:economic:bis:eer', maxStaleMin: 2880 },
102-
bisCredit: { key: 'seed-meta:economic:bis:credit', maxStaleMin: 2880 },
100+
bisPolicy: { key: 'seed-meta:economic:bis:policy', maxStaleMin: 10080 },
101+
bisExchange: { key: 'seed-meta:economic:bis:eer', maxStaleMin: 10080 },
102+
bisCredit: { key: 'seed-meta:economic:bis:credit', maxStaleMin: 10080 },
103103
shippingRates: { key: 'seed-meta:supply_chain:shipping', maxStaleMin: 420 },
104104
chokepoints: { key: 'seed-meta:supply_chain:chokepoints', maxStaleMin: 60 },
105105
minerals: { key: 'seed-meta:supply_chain:minerals', maxStaleMin: 10080 },
@@ -146,6 +146,7 @@ const ON_DEMAND_KEYS = new Set([
146146
'macroSignals', 'shippingRates', 'chokepoints', 'minerals', 'giving',
147147
'cyberThreatsRpc', 'militaryBases', 'temporalAnomalies', 'displacement',
148148
'corridorrisk', // intermediate key; data flows through transit-summaries:v1
149+
'serviceStatuses', // RPC-populated; seed-meta written on fresh fetch only, goes stale between visits
149150
]);
150151

151152
// Keys where 0 records is a valid healthy state (e.g. no airports closed).

0 commit comments

Comments
 (0)