mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 03:32:19 +00:00
The branch read the /states/all cooldown from /api/flights and never set one from /tracks/all, which is backwards for an API that meters the two separately: a flights cooldown blocked backfill that still had credits, and a /tracks 429 left every other icao24 free to ask again. tracks.js now keeps a cooldown for the /tracks bucket, armed by a 429 from /tracks/all with OpenSky's retry-after (opensky.js exports its existing parser so both buckets read the header the same way). The two routes get separate limiters, and a limiter refusal sends Retry-After 60, the window, rather than 10.
11 lines
755 B
Markdown
11 lines
755 B
Markdown
- Stop the track-backfill proxies from turning a varied `icao24`/`hex` into
|
|
unbounded upstream spend. `/api/flights/track` and `/api/military/track`
|
|
each carry an always-on 30-per-minute per-client limiter (90 global), and a
|
|
`429` from OpenSky `/tracks/all` now starts a cooldown for that credit
|
|
bucket: until OpenSky's retry-after passes, any cached track is served and
|
|
other lookups are answered `429` locally instead of asking for 4 more
|
|
credits. The `/tracks/*` bucket is separate from the `/states/*` one
|
|
`/api/flights` spends, so a flights cooldown does not block backfill. The
|
|
existing 60-second per-key cache bounds memory, not spend. Single-aircraft
|
|
backfill, issued once per selected contact, is unaffected (daikaginza, #685).
|