mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 08:48:13 +00:00
Improve job management. Remove archived flag.
This commit is contained in:
@@ -56,10 +56,8 @@ class RenderQueue:
|
||||
return pending_jobs
|
||||
|
||||
@classmethod
|
||||
def jobs_with_status(cls, status, priority_sorted=False, include_archived=True):
|
||||
def jobs_with_status(cls, status, priority_sorted=False):
|
||||
found_jobs = [x for x in cls.job_queue if x.render_status() == status]
|
||||
if not include_archived:
|
||||
found_jobs = [x for x in found_jobs if not x.archived]
|
||||
if priority_sorted:
|
||||
found_jobs = sorted(found_jobs, key=lambda a: a.priority, reverse=False)
|
||||
return found_jobs
|
||||
@@ -73,8 +71,8 @@ class RenderQueue:
|
||||
def clear_history(cls):
|
||||
to_remove = [x for x in cls.job_queue if x.render_status() in [RenderStatus.CANCELLED,
|
||||
RenderStatus.COMPLETED, RenderStatus.ERROR]]
|
||||
for x in to_remove:
|
||||
x.archived = True
|
||||
for job_to_remove in to_remove:
|
||||
cls.job_queue.remove(job_to_remove)
|
||||
cls.save_state()
|
||||
|
||||
@classmethod
|
||||
@@ -204,11 +202,6 @@ class RenderQueue:
|
||||
|
||||
return stats
|
||||
|
||||
@classmethod
|
||||
def all_jobs(cls):
|
||||
all_jobs = [x for x in cls.job_queue if not x.archived]
|
||||
return all_jobs
|
||||
|
||||
@classmethod
|
||||
def register_client(cls, hostname):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user