job_queue: never transition after complete unless auto is enabled
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
110cbd1084
commit
6b73da55f8
|
@ -89,6 +89,8 @@ class JobQueue:
|
||||||
prev_stats: Dict[str, Any],
|
prev_stats: Dict[str, Any],
|
||||||
new_stats: Dict[str, Any]
|
new_stats: Dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
|
if not self.automatic:
|
||||||
|
return
|
||||||
async with self.lock:
|
async with self.lock:
|
||||||
# Transition to the next job in the queue
|
# Transition to the next job in the queue
|
||||||
if self.queue_state == "ready" and self.queued_jobs:
|
if self.queue_state == "ready" and self.queued_jobs:
|
||||||
|
@ -216,7 +218,8 @@ class JobQueue:
|
||||||
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:
|
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]]:
|
def _job_map_to_list(self) -> List[Dict[str, Any]]:
|
||||||
cur_time = time.time()
|
cur_time = time.time()
|
||||||
return [job.as_dict(cur_time) for
|
return [job.as_dict(cur_time) for
|
||||||
|
|
Loading…
Reference in New Issue