Merge pull request #839 from dajiaohuang/docs/fix-adsbdb-cache-ttl

docs: correct ADSBDB cache TTL note
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-10-17 12:07:42 -07:00
commit 200a83465b
2 files changed
+7 -6

No files matched your search

+3 -2
View File
@@ -7,8 +7,9 @@ const ADSBDB_MAX_RESPONSE_BYTES = 1024 * 1024;
/** /**
* adsbdb.com enrichment proxy: callsign → route (airline + origin/destination * adsbdb.com enrichment proxy: callsign → route (airline + origin/destination
* airports) and hex → aircraft type/registration. Free community API — cached * airports) and hex → aircraft type/registration. Free community API — cached
* aggressively: ONE upstream request per new key ever (404s negative-cached), * aggressively: successes and 404s are kept per key for 24 hours (TTL_MS) and
* persisted to disk so restarts don't re-hammer it. Adapted from skylight * persisted to disk so restarts don't re-hammer it; other failures are not
* cached. Adapted from skylight
* (MIT) server/src/enrich/routes.ts. * (MIT) server/src/enrich/routes.ts.
*/ */
export function adsbdbProxy() { export function adsbdbProxy() {
+4 -4
View File
@@ -219,8 +219,8 @@ export const COURSE_SLEW_DT_MAX_SEC = 0.25;
// adsbdb enrichment (best-effort, fail-silent). Bounded fan-out: max 4 // adsbdb enrichment (best-effort, fail-silent). Bounded fan-out: max 4
// concurrent requests, dispatches dripped ≥ENRICH_DISPATCH_GAP_MS apart // concurrent requests, dispatches dripped ≥ENRICH_DISPATCH_GAP_MS apart
// (≤5/s — adsbdb is a free community API; the dev-server proxy additionally // (≤5/s — adsbdb is a free community API; the dev-server proxy additionally
// caches per-key on disk forever, negative results included, so repeat // caches successful and 404 responses per key for 24 hours, so later sessions
// sessions never re-hit adsbdb). Each key is requested at most once per // may refresh them). Each key is requested at most once per
// session. Priority jobs (tracked plane, model-eligible planes) jump the // session. Priority jobs (tracked plane, model-eligible planes) jump the
// queue; the ambient fleet sweep (below) fills the back at poll cadence. // queue; the ambient fleet sweep (below) fills the back at poll cadence.
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -243,7 +243,7 @@ export const ENRICH_DISPATCH_GAP_MS = 200;
// of drip, so the backlog can't outgrow a poll and re-sorts fresh), and // of drip, so the backlog can't outgrow a poll and re-sorts fresh), and
// - a ROLLING token-bucket budget (below) bounding the sustained ambient // - a ROLLING token-bucket budget (below) bounding the sustained ambient
// request rate (repeat sessions resolve instantly from the proxy's // request rate (repeat sessions resolve instantly from the proxy's
// permanent disk cache). // 24-hour disk cache).
// Fail-silent by contract: the sweep never throws into the poll loop, never // Fail-silent by contract: the sweep never throws into the poll loop, never
// blocks rendering, and never touches tracking state. When a type answer // blocks rendering, and never touches tracking state. When a type answer
// lands, _requestTypeEnrichment's callback swaps the billboard glyph + scale // lands, _requestTypeEnrichment's callback swaps the billboard glyph + scale
@@ -257,7 +257,7 @@ export const ENRICH_DISPATCH_GAP_MS = 200;
// ENRICH_AMBIENT_REFILL_TOKENS every ENRICH_AMBIENT_REFILL_WINDOW_MS, clamped // ENRICH_AMBIENT_REFILL_TOKENS every ENRICH_AMBIENT_REFILL_WINDOW_MS, clamped
// at the ceiling (no banking beyond one bucket). Numbers: 150 / 5 min sustains // at the ceiling (no banking beyond one bucket). Numbers: 150 / 5 min sustains
// 0.5 req/s worst case — an order of magnitude under the 5/s drip that (with // 0.5 req/s worst case — an order of magnitude under the 5/s drip that (with
// the 4-concurrent limit + the proxy's permanent disk cache) is the REAL // the 4-concurrent limit + the proxy's 24-hour disk cache) is the REAL
// politeness bound on adsbdb; the 300 ceiling preserves the old first-look // politeness bound on adsbdb; the 300 ceiling preserves the old first-look
// burst so a fresh region still classifies quickly. // burst so a fresh region still classifies quickly.
/** Bucket ceiling: max ambient tokens held at once (= the initial burst). */ /** Bucket ceiling: max ambient tokens held at once (= the initial burst). */