1
0
Fork 0

fix(api): do not move jobs from pending to running until progress is reported

This commit is contained in:
Sean Sube 2023-03-26 14:22:59 -05:00
parent 0af406c47f
commit 27500eccb5
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 2 additions and 4 deletions

View File

@ -195,9 +195,7 @@ class DevicePoolExecutor:
for job in self.pending_jobs: for job in self.pending_jobs:
if job.name == key: if job.name == key:
self.pending_jobs[:] = [ self.pending_jobs.remove(job)
job for job in self.pending_jobs if job.name != key
]
logger.info("cancelled pending job: %s", key) logger.info("cancelled pending job: %s", key)
return True return True
@ -414,7 +412,7 @@ class DevicePoolExecutor:
if job.device == device: if job.device == device:
logger.debug("enqueuing job %s on device %s", job.name, device) logger.debug("enqueuing job %s on device %s", job.name, device)
self.pending[device].put(job, block=False) self.pending[device].put(job, block=False)
self.pending_jobs.remove(job) # job will be removed from pending queue when progress is updated
return return
logger.trace("no pending jobs for device %s", device) logger.trace("no pending jobs for device %s", device)