mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Add UI notifications to a try block
This commit is contained in:
@@ -59,27 +59,30 @@ class DistributedJobManager:
|
||||
RenderServerProxy(hostname).cancel_job(child_id, confirm=True)
|
||||
|
||||
# UI Notifications
|
||||
if new_status == RenderStatus.COMPLETED:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Complete',
|
||||
message=f'{render_job.name} completed succesfully',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
elif new_status == RenderStatus.ERROR:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Failed',
|
||||
message=f'{render_job.name} failed rendering',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
elif new_status == RenderStatus.RUNNING:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Started',
|
||||
message=f'{render_job.name} started rendering',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
try:
|
||||
if new_status == RenderStatus.COMPLETED:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Complete',
|
||||
message=f'{render_job.name} completed succesfully',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
elif new_status == RenderStatus.ERROR:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Failed',
|
||||
message=f'{render_job.name} failed rendering',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
elif new_status == RenderStatus.RUNNING:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Started',
|
||||
message=f'{render_job.name} started rendering',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
except Exception as e:
|
||||
logger.debug(f"Unable to show UI notification: {e}")
|
||||
|
||||
@classmethod
|
||||
def handle_subjob_status_change(cls, local_job, subjob_data):
|
||||
|
||||
Reference in New Issue
Block a user