Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add route lookup via adsbdb.com #231

Closed
wants to merge 2 commits into from
Closed

Add route lookup via adsbdb.com #231

wants to merge 2 commits into from

Conversation

dirkhh
Copy link
Contributor

@dirkhh dirkhh commented Mar 14, 2023

This adds a rate limiting library and a reference to axios in order to easily and cleanly allow API accesses without exceeding the rate limits of the API provider. The way this was done might be a bit inconsistent given that for example jQuery is simply copied into this source base.

Once the app receives a callsign for a flight (and that is different from the registration - as asdbdb doesn't track 'live flight plans') it checks if there is already route information for this flight cached and if not it makes an API call to adsbdb.com to look up the origin and destination of that flight.

The code tries to be very careful not to run afoul of the rate limit of that free site - right now this is hopefully conservative enough that even people running a couple of different tar1090 instances won't get in trouble - but one can create a scenario where power users with many windows open might still end up with too many API requests.

As a workaround for people who intentionally keep many parallel instances open there is a config option to turn the route lookup off (right now it is turned on by default).

This adds a rate limiting library and a reference to axios in order
to easily and cleanly allow API accesses without exceeding the rate
limits of the API provider. The way this was done might be a bit
inconsistent given that for example jQuery is simply copied into
this source base.

Once the app receives a callsign for a flight (and that is different
from the registration - as asdbdb doesn't track 'live flight plans')
it checks if there is already route information for this flight cached
and if not it makes an API call to adsbdb.com to look up the origin
and destination of that flight.

The code tries to be very careful not to run afoul of the rate limit
of that free site - right now this is hopefully conservative enough
that even people running a couple of different tar1090 instances won't
get in trouble - but one can create a scenario where power users with
many windows open might still end up with too many API requests.

As a workaround for people who intentionally keep many parallel
instances open there is a config option to turn the route lookup off
(right now it is turned on by default).

Signed-off-by: Dirk Hohndel <[email protected]>
That way there is no behavior change when upgrading.

Signed-off-by: Dirk Hohndel <[email protected]>
@dirkhh dirkhh marked this pull request as draft March 16, 2023 13:50
@dirkhh
Copy link
Contributor Author

dirkhh commented Mar 16, 2023

Given the feedback regarding the amount of API requests this can create, I think I may redesign this to work differently. Let's pause here for a moment while I find time to study this a bit more.

@dirkhh
Copy link
Contributor Author

dirkhh commented Mar 20, 2023

replaced by #232

@dirkhh dirkhh closed this Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant