worktree-citti-arkiver-tur #7

Merged
hjess merged 2 commits from worktree-citti-arkiver-tur into main 2026-10-30 12:28:48 +01:00

2 Commits

Author SHA1 Message Date
Henrik Jess Nielsen
c5e4a326e0 chore(deploy): prefer a dedicated API key over the shared OAuth token
The OAuth token shares one rate budget across everything on the subscription
(incl. interactive Claude Code sessions), so citti's translation is almost
always throttled while coding — hence the page staying German. Template now
emits ANTHROPIC_API_KEY from citti/anthropic_api_key when set (its own rate
budget, no contention), else the OAuth token. Only one var is written so an
empty key can't shadow the token.
2026-10-30 12:19:45 +01:00
Henrik Jess Nielsen
67ffc07a04 fix(offers): background refresh + skip unchanged matching
Two things made Opdater show 'Opdatering fejlede': the refresh ran
synchronously (so a slow, rate-limited translate timed out the browser)
and a 429 returned 502. Now:
- /api/offers/refresh starts the work in a background thread and returns
  immediately; the button says 'Opdaterer i baggrunden' and reloads a bit
  later as batches land. A lock prevents overlapping runs.
- match_offers_ai skips the Claude call when the offer set is unchanged
  since the last successful match (hashed), so it runs ~weekly (when the
  avis turns over), not every daily refresh — fewer calls, less cost, less
  rate pressure.
2026-10-30 12:16:30 +01:00