arnaudne e94f7a0ca6 Prevent concurrent job pile-up and fix nightly_cache lock contention
- Add shared Arc<Semaphore> (1 permit) through main → AppState and jobs.
  All heavy operations (catalog refresh, rebuild, nightly recompute,
  factory reset) now serialise: a second trigger returns "already_running"
  instead of spawning a parallel task that fights over the SQLite WAL lock.
- Scheduled nightly job acquires the semaphore too, so it waits rather
  than stomping on a manual rebuild triggered at startup.
- Replace 90 × precompute_lightweight calls (90 separate transactions,
  horizon fetched 90 times) with precompute_next_90_nights: one bulk
  SELECT to find missing dates, horizon fetched once, all inserts in a
  single transaction. Eliminates the 1–5s per-INSERT lock waits seen
  when multiple jobs were competing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 11:29:37 +02:00
2026-04-10 00:20:32 +02:00
2026-04-10 00:20:32 +02:00
2026-04-10 23:33:09 +02:00
2026-04-10 23:33:09 +02:00
2026-04-10 23:33:09 +02:00
2026-04-10 23:33:09 +02:00
S
Description
No description provided
128 MiB
Languages
Rust 51%
TypeScript 47.7%
CSS 1.1%
Dockerfile 0.1%
HTML 0.1%