mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Improved handling of creating job JSONs as well as better handle loading saved JSONs
This commit is contained in:
@@ -106,8 +106,10 @@ class RenderQueue:
|
||||
if key in ['date_created']: # convert date strings back to datetime objects
|
||||
render_job.__dict__[key] = datetime.fromisoformat(val)
|
||||
else:
|
||||
render_job.__dict__[key] = val
|
||||
render_job.__delattr__('status')
|
||||
import types
|
||||
if hasattr(render_job, key):
|
||||
if getattr(render_job, key) and not isinstance(getattr(render_job, key), types.MethodType):
|
||||
render_job.__dict__[key] = val
|
||||
|
||||
# Handle older loaded jobs that were cancelled before closing
|
||||
if render_job.render_status() == RenderStatus.RUNNING:
|
||||
@@ -116,7 +118,7 @@ class RenderQueue:
|
||||
# finally add back to render queue
|
||||
cls.job_queue.append(render_job)
|
||||
except Exception as e:
|
||||
logger.error(f"Unable to load job: {job} - {e}")
|
||||
logger.exception(f"Unable to load job: {job['id']} - {e}")
|
||||
|
||||
cls.last_saved_counts = cls.job_counts()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user