Misc cleanup

This commit is contained in:
Brett Williams
2023-10-25 18:53:41 -05:00
parent a5e9ac0014
commit cc1d6ba452
4 changed files with 35 additions and 43 deletions

View File

@@ -65,10 +65,12 @@ class RenderQueue:
@classmethod
def job_with_id(cls, job_id, none_ok=False):
found_job = next((x for x in cls.all_jobs() if x.id == job_id), None)
if not found_job and not none_ok:
raise JobNotFoundError(job_id)
return found_job
for job in cls.all_jobs():
if job.id == job_id:
return job
if not none_ok:
raise JobNotFoundError(f"Cannot find job with id: {job_id}")
return None
@classmethod
def clear_history(cls):