prop/lib/microwaveprop
Graham McIntire a24ce027f4 Fix /weather 500 on cold cache, untrack k8s secret
The /weather LiveView was timing out on pod restart because
latest_weather_grid/1 ran load_weather_grid_from_db/1 synchronously on
cache miss — that query reads 176k hrrr_profiles rows with two huge
JSONB columns (profile array + duct_characteristics), and JSONB
decoding blocked the LiveView process past the 15-second pool
ownership timeout.

On cache miss latest_weather_grid/1 now returns empty immediately and
kicks off a deduped background fill through GridCache.claim_fill/1 (a
per-valid_time ETS lock so N concurrent mounts after restart don't each
fire the slow query). When the fill completes it broadcasts
weather:updated, and the handle_info in WeatherMapLive hits the warm
cache and pushes rows over the socket.

Added load_weather_grid/1 as a synchronous sibling for tests and any
caller that genuinely needs inline data. Tests updated to use it and
to clear GridCache in setup so ETS state doesn't leak between cases.

Also untrack k8s/secret.yaml and add both it and k8s/*-secret.yaml to
.gitignore — those manifests hold plaintext SMTP and database
credentials that should not live in the repo. Secrets already in git
history should be rotated separately.
2026-04-12 13:56:59 -05:00
..
accounts Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
backtest Fix all 12 dialyzer warnings 2026-04-11 18:08:18 -05:00
beacon_monitors Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
beacons Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
commercial Fix all remaining credo --strict issues (0 issues) 2026-04-12 10:26:53 -05:00
propagation Add more caching to make the map feel instant 2026-04-12 12:26:25 -05:00
radio Normalize ADIF MODE/SUBMODE and document the mapping 2026-04-12 13:15:31 -05:00
terrain Fix all remaining credo --strict issues (0 issues) 2026-04-12 10:26:53 -05:00
weather Fix /weather 500 on cold cache, untrack k8s secret 2026-04-12 13:56:59 -05:00
workers Cache /weather grid, defer contact show mount, cache stats 2026-04-12 12:55:50 -05:00
accounts.ex Add /beacons CRUD and /users admin page 2026-04-08 12:01:45 -05:00
application.ex Cache /weather grid, defer contact show mount, cache stats 2026-04-12 12:55:50 -05:00
backtest.ex Phase 9.3, 9.4, and Phase 3 NEXRAD pipeline 2026-04-10 12:48:36 -05:00
beacon_monitors.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
beacons.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
cache.ex Cache /contacts, fix map blink, make mode optional 2026-04-12 12:47:25 -05:00
commercial.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
geo.ex Fix all remaining credo --strict issues (0 issues) 2026-04-12 10:26:53 -05:00
mailer.ex initial 2026-03-28 11:28:47 -05:00
markdown.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
propagation.ex Add more caching to make the map feel instant 2026-04-12 12:26:25 -05:00
radio.ex Serve /contacts/map payload via HTTP endpoint, parallel hydrate 2026-04-12 13:10:51 -05:00
release.ex Fix all remaining credo --strict issues (0 issues) 2026-04-12 10:26:53 -05:00
repo.ex initial 2026-03-28 11:28:47 -05:00
repo_listener.ex Replace polling with Postgres LISTEN/NOTIFY for live updates 2026-04-02 16:26:22 -05:00
terrain.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
weather.ex Fix /weather 500 on cold cache, untrack k8s secret 2026-04-12 13:56:59 -05:00