Files
worldmonitor/scripts
Elie Habib c4c03e7e65 fix(consumer-prices): restore seed script + fix publish job writing to wrong Redis (#1966)
* fix(consumer-prices): restore dropped seed script, fix maxStaleMin

seed-consumer-prices.mjs was included in PR #1901 but accidentally
dropped during a subsequent squash merge. Restored verbatim from the
PR diff. The script fetches from consumer-prices-core and writes all
Redis keys (overview, categories, movers, spread, freshness, series).

Also corrects health.js maxStaleMin values from 2880 (48h) to match
actual seed TTLs: overview/categories/movers=90min, spread=120min,
freshness=30min. The previous values would mask outages for 2 days.

Needs CONSUMER_PRICES_CORE_BASE_URL set in Railway env to produce
real data. Without it the script writes empty-but-valid placeholders.

* fix(consumer-prices): switch publish job to Upstash HTTP REST client

Replaced standard redis TCP client (REDIS_URL → Valkey) with Upstash
HTTP REST calls (UPSTASH_REDIS_REST_URL + UPSTASH_REDIS_REST_TOKEN),
matching the pattern used by all other seed scripts. This is why all
consumer-prices Redis keys were permanently empty — publish.ts was
writing to Railway-internal Valkey instead of Upstash.

Railway env vars added to seed-consumer-prices service separately.
2026-03-21 08:36:35 +04:00
..
2026-03-20 12:37:24 +04:00