mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Fix SSE first-byte delay in ADS-B and controller streams; harden WebSocket init
- Add immediate keepalive to /adsb/stream generator so the Werkzeug dev server flushes response headers immediately on tracking start, preventing the 30-second delay before the aircraft map begins receiving data - Same fix for /controller/stream/all used by the ADSB dashboard in agent mode - Widen WebSocket init exception guards in app.py from ImportError to Exception so any startup failure (e.g. RuntimeError from flask-sock on an unsupported WSGI server) is caught instead of propagating Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1167,6 +1167,9 @@ def stream_adsb():
|
||||
|
||||
def generate():
|
||||
last_keepalive = time.time()
|
||||
# Send immediate keepalive so Werkzeug dev server flushes response
|
||||
# headers right away (it buffers until first body byte is written).
|
||||
yield format_sse({'type': 'keepalive'})
|
||||
|
||||
try:
|
||||
while True:
|
||||
|
||||
@@ -673,6 +673,7 @@ def stream_all_agents():
|
||||
def generate() -> Generator[str, None, None]:
|
||||
last_keepalive = time.time()
|
||||
keepalive_interval = 30.0
|
||||
yield format_sse({'type': 'keepalive'})
|
||||
|
||||
try:
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user