Add UI notifications to a try block

This commit is contained in:
Brett Williams
2023-10-25 21:52:08 -05:00
parent 32d863f624
commit deac943e4c

View File

@@ -59,27 +59,30 @@ class DistributedJobManager:
RenderServerProxy(hostname).cancel_job(child_id, confirm=True) RenderServerProxy(hostname).cancel_job(child_id, confirm=True)
# UI Notifications # UI Notifications
if new_status == RenderStatus.COMPLETED: try:
logger.debug("show render complete notification") if new_status == RenderStatus.COMPLETED:
notification.notify( logger.debug("show render complete notification")
title='Render Job Complete', notification.notify(
message=f'{render_job.name} completed succesfully', title='Render Job Complete',
timeout=10 # Display time in seconds message=f'{render_job.name} completed succesfully',
) timeout=10 # Display time in seconds
elif new_status == RenderStatus.ERROR: )
logger.debug("show render complete notification") elif new_status == RenderStatus.ERROR:
notification.notify( logger.debug("show render complete notification")
title='Render Job Failed', notification.notify(
message=f'{render_job.name} failed rendering', title='Render Job Failed',
timeout=10 # Display time in seconds message=f'{render_job.name} failed rendering',
) timeout=10 # Display time in seconds
elif new_status == RenderStatus.RUNNING: )
logger.debug("show render complete notification") elif new_status == RenderStatus.RUNNING:
notification.notify( logger.debug("show render complete notification")
title='Render Job Started', notification.notify(
message=f'{render_job.name} started rendering', title='Render Job Started',
timeout=10 # Display time in seconds 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 @classmethod
def handle_subjob_status_change(cls, local_job, subjob_data): def handle_subjob_status_change(cls, local_job, subjob_data):