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.
755 B
755 B
- Stop the track-backfill proxies from turning a varied
icao24/hexinto unbounded upstream spend./api/flights/trackand/api/military/trackeach carry an always-on 30-per-minute per-client limiter (90 global), and a429from OpenSky/tracks/allnow starts a cooldown for that credit bucket: until OpenSky's retry-after passes, any cached track is served and other lookups are answered429locally instead of asking for 4 more credits. The/tracks/*bucket is separate from the/states/*one/api/flightsspends, 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).