From f09c313c5be6361d7f4464153e84d63be2fce4fb Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Fri, 26 Nov 2021 17:32:01 -0500 Subject: [PATCH] job_queue: fix resume request Make sure that the queue is set to ready after resuming, even if the next job is unable to be loaded. Signed-off-by: Eric Callahan --- moonraker/components/job_queue.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/moonraker/components/job_queue.py b/moonraker/components/job_queue.py index e966b50..9c182a2 100644 --- a/moonraker/components/job_queue.py +++ b/moonraker/components/job_queue.py @@ -242,13 +242,14 @@ class JobQueue: web_request: WebRequest ) -> Dict[str, Any]: async with self.lock: - if self.queue_state == "paused": - self.queue_state = "ready" - if self.queued_jobs and self.pop_queue_handle is None: + if self.queue_state != "loading": + if self.queued_jobs and await self._check_can_print(): self.queue_state = "loading" event_loop = self.server.get_event_loop() self.pop_queue_handle = event_loop.delay_callback( 0.01, self._pop_job) + else: + self.queue_state = "ready" return { 'queued_jobs': self._job_map_to_list(), 'queue_state': self.queue_state