fix(api): do not move jobs from pending to running until progress is reported
This commit is contained in:
parent
0af406c47f
commit
27500eccb5
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue