+39
−10
+4
−1
+6
−4
Loading
get_live_data() was called synchronously inside async route handlers
(fits_image.py's /info, /png, /panoramic, /tile, and the WS
tile-request handler) — device.matrix can block on real I/O (SDK
locks with up to 5s timeouts, or slow connection probing with no
camera attached), which froze the entire event loop, not just the
requesting client. Wrapped every call in asyncio.to_thread, matching
what stream.py's broadcast loop already did correctly.
Also: device.matrix only reflects a frame acquired in the current
process's session, so it's None right after a server restart until
the first Expose/Loop — unlike the old file read, which always showed
the last frame regardless of restarts. get_live_data() now falls back
to the last FITS file on disk when matrix is empty, restoring that
behavior while keeping the live path for everything else.
Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com>