job_queue: never transition after complete unless auto is enabled

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-04-04 11:03:12 -04:00
parent 110cbd1084
commit 6b73da55f8
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 4 additions and 1 deletions

View File

@ -89,6 +89,8 @@ class JobQueue:
prev_stats: Dict[str, Any],
new_stats: Dict[str, Any]
) -> None:
if not self.automatic:
return
async with self.lock:
# Transition to the next job in the queue
if self.queue_state == "ready" and self.queued_jobs:
@ -216,7 +218,8 @@ class JobQueue:
self.pop_queue_handle = event_loop.delay_callback(
0.01, self._pop_job)
else:
self._set_queue_state("ready")
qs = "paused" if self.automatic else "ready"
self._set_queue_state(qs)
def _job_map_to_list(self) -> List[Dict[str, Any]]:
cur_time = time.time()
return [job.as_dict(cur_time) for