Skip to content

list-military-flights: add NEG_TTL to fetchStaleFallback #3277

Description

@SebastienMelki

Minor parity gap vs legacy flagged in #3242 second-pass review by @koala73.

Problem: fetchStaleFallback in server/worldmonitor/military/v1/list-military-flights.ts has no negative cache. Every failed live fetch hits Redis on the next request.

Legacy behavior: legacy had NEG_TTL = 30_000 — a short in-memory negative cache that suppressed the stale-read attempt for 30s after a failed live fetch.

Impact: low. Redis is cheap, and stale reads are the backup path not the hot path. Flagging for parity with the legacy cascade.

Fix sketch: add a module-scoped Map<bboxKey, timestamp> or simple variable with 30s TTL to suppress re-fetching the stale Redis key immediately after a failed live attempt.

Context: flagged in #3242 review — deferred from that PR to keep scope bounded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: APIBackend API, sidecar, keys

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions