fix(adsb): keep aircraft ingest alive with no browser viewport #68

Merged
sirius merged 1 commit from fix/adsb-idle-watch-poll into master 2026-11-21 22:30:58 +00:00
Owner

aircraft_positions had no rows after 2026-11-20 04:58 UTC although USGS/news ingest kept running: the ADSB refresh loop in app/main.py only polls manager.viewports() (browser tabs), so with nobody watching the map it persists nothing.

When no client viewport is registered the loop now sweeps the chokepoint presets through the same fetch_aircraft(persist=True) path.

  • ADSB_REFRESH_INTERVAL (8 s, client viewports)
  • ADSB_WATCH_ENABLED (1) / ADSB_WATCH_INTERVAL (30 s, idle sweep over 5 boxes, 65-81 nm radius each)

Verified live inside the old pod by running the new loop with no viewport: 5x ADSB.lol 200s per cycle for 75 s, aircraft_positions gained 164 rows in 5 min and max(ts) advanced to 22:30 UTC.

Tests: tests/test_adsb_watch.py (3 pass).

`aircraft_positions` had no rows after 2026-11-20 04:58 UTC although USGS/news ingest kept running: the ADSB refresh loop in `app/main.py` only polls `manager.viewports()` (browser tabs), so with nobody watching the map it persists nothing. When no client viewport is registered the loop now sweeps the chokepoint presets through the same `fetch_aircraft(persist=True)` path. - `ADSB_REFRESH_INTERVAL` (8 s, client viewports) - `ADSB_WATCH_ENABLED` (1) / `ADSB_WATCH_INTERVAL` (30 s, idle sweep over 5 boxes, 65-81 nm radius each) Verified live inside the old pod by running the new loop with no viewport: 5x ADSB.lol 200s per cycle for 75 s, `aircraft_positions` gained 164 rows in 5 min and `max(ts)` advanced to 22:30 UTC. Tests: `tests/test_adsb_watch.py` (3 pass).
The ADSB refresh loop only persisted positions for registered WS viewports,
so aircraft_positions went silent for a day whenever nobody had the map open
(max(ts) frozen at 2026-11-20 04:58 while USGS/news ingest kept running).

When no client viewport is registered the loop now sweeps the chokepoint
presets (ADSB_WATCH_ENABLED=1, ADSB_WATCH_INTERVAL=30s, 5 boxes ~65-81 nm)
through the same fetch_aircraft(persist=True) path, so the hypertable and
aircraft_tracks_1min keep advancing unattended. Viewport polling keeps its
8 s cadence when a tab is connected.
sirius merged commit 54897b49bc into master 2026-11-21 22:30:58 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/osint-dashboard!68
No description provided.