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 <arksine.code@gmail.com>
This commit is contained in:
parent
d25c3c1d49
commit
f09c313c5b
|
@ -242,13 +242,14 @@ class JobQueue:
|
||||||
web_request: WebRequest
|
web_request: WebRequest
|
||||||
) -> Dict[str, Any]:
|
) -> Dict[str, Any]:
|
||||||
async with self.lock:
|
async with self.lock:
|
||||||
if self.queue_state == "paused":
|
if self.queue_state != "loading":
|
||||||
self.queue_state = "ready"
|
if self.queued_jobs and await self._check_can_print():
|
||||||
if self.queued_jobs and self.pop_queue_handle is None:
|
|
||||||
self.queue_state = "loading"
|
self.queue_state = "loading"
|
||||||
event_loop = self.server.get_event_loop()
|
event_loop = self.server.get_event_loop()
|
||||||
self.pop_queue_handle = event_loop.delay_callback(
|
self.pop_queue_handle = event_loop.delay_callback(
|
||||||
0.01, self._pop_job)
|
0.01, self._pop_job)
|
||||||
|
else:
|
||||||
|
self.queue_state = "ready"
|
||||||
return {
|
return {
|
||||||
'queued_jobs': self._job_map_to_list(),
|
'queued_jobs': self._job_map_to_list(),
|
||||||
'queue_state': self.queue_state
|
'queue_state': self.queue_state
|
||||||
|
|
Loading…
Reference in New Issue