mirror of
https://github.com/myronblair/kino-app
synced 2026-07-27 21:18:43 -05:00
ef5c13d587
scan() was doing hundreds of blocking Path.is_file()/stat() calls directly in an async function -- movie/episode/track files often live on the NFS/CIFS-mounted NAS, so each stat call has real network latency. Since the backend runs a single-threaded asyncio event loop, this froze every other request (confirmed live: a plain GET /api/movies hung for 60s+ while a cleanup scan was in flight) for as long as the scan took. Moved every filesystem-touching check (missing files, orphaned HLS dirs) into a plain sync function run via asyncio.to_thread, so the scan can no longer block anything else.