Fix RuntimeError when unlinking Spoolman spool from holder modal
_moonraker_set_active_spool used asyncio.ensure_future which requires a running event loop in the current thread. Sync FastAPI endpoints run in an AnyIO worker thread that has no event loop, so unlinking the SP slot (which triggers CLEAR_ACTIVE_SPOOL in moonraker mode) crashed with RuntimeError: There is no current event loop in thread. Replace the async wrapper + ensure_future with a plain daemon thread. _moonraker_send_gcode is already a blocking HTTP call, so no executor indirection is needed — a thread achieves the same fire-and-forget goal while working from both async and sync call sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
K
koen01 committed
92cca4eb40bdb6fc628321b7917c63d3452a2559
Parent: f97d392