From 84fe13dd07b52ec38b78f9a9ecb7036b3534d7d7 Mon Sep 17 00:00:00 2001 From: maziggy Date: Tue, 27 Jan 2026 15:16:18 +0100 Subject: [PATCH] Fix print queue not starting when printer state is FAILED The print scheduler only considered IDLE, FINISH, and unknown as valid idle states. This caused the queue to not process items when the printer was in FAILED state (e.g., after an aborted print). Added FAILED to the list of idle states since a failed print means the printer is ready to accept a new print job. --- backend/app/services/print_scheduler.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/services/print_scheduler.py b/backend/app/services/print_scheduler.py index f685073fc..af5440f06 100644 --- a/backend/app/services/print_scheduler.py +++ b/backend/app/services/print_scheduler.py @@ -126,8 +126,9 @@ class PrintScheduler: if not state: return False - # Printer is idle if state is IDLE or FINISH - return state.state in ("IDLE", "FINISH", "unknown") + # Printer is idle if state is IDLE, FINISH, FAILED, or unknown + # FAILED means previous print failed, printer is ready for new print + return state.state in ("IDLE", "FINISH", "FAILED", "unknown") async def _get_smart_plug(self, db: AsyncSession, printer_id: int) -> SmartPlug | None: """Get the smart plug associated with a printer."""