mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 03:32:19 +00:00
fix(server): stop track backfill from spending the OpenSky credit budget
`/api/opensky-track` costs 4 OpenSky credits per call against the same ~4000/day account as `/api/opensky`, but participated in none of that proxy's credit governor. Its 60-second per-icao cache bounds memory, not spend: `icao24` is six hex digits, so a caller that varies it produces a fresh key and a fresh upstream call every time. Both track-backfill routes now carry an always-on 30/min per-client limiter (90 global) — the band `/api/geocode` and `/api/regional-brief` already use, and far above the real demand, which is one backfill per aircraft the operator selects. `/api/opensky-track` additionally reads the 429 cooldown `/api/opensky` already maintains. While the account is out of budget it serves any cached track and otherwise answers 429 with the remaining cooldown, instead of minting a token and spending four more credits. adsb.lol is free and unmetered, so only the limiter applies there.
This commit is contained in:
1 parent
b210ab0fe4
commit
65018015a0
7 files changed
+313
-6
No files matched your search
@@ -1,5 +1,16 @@
|
||||
# Changelog
|
||||
|
||||
- Stop the track-backfill proxies from spending the OpenSky credit budget the
|
||||
main flights proxy is protecting. `/api/opensky-track` and
|
||||
`/api/adsblol/trace` now carry an always-on 30-per-minute per-client limiter
|
||||
(90 global), and `/api/opensky-track` honours the 429 cooldown that
|
||||
`/api/opensky` already sets: while the account is out of budget it serves any
|
||||
cached track and otherwise answers `429` with the remaining cooldown rather
|
||||
than spending 4 more credits. The existing 60-second per-key cache bounds
|
||||
memory, not spend — a caller varying `icao24` produced a fresh upstream call
|
||||
every time. Single-aircraft backfill, which is issued once per selected
|
||||
contact, is unaffected.
|
||||
|
||||
- CCTV cameras whose bearing is a guess now say so. Packs mark bearings derived
|
||||
from a hash of the camera id as `headingConfidence: 'low'`, but nothing read the
|
||||
flag, so roughly 70% of a default catalog rendered like surveyed facings. The HUD
|
||||
|
||||
Reference in new issue
Block a user