Cancel all children if parent job is cancelled

This commit is contained in:
Brett Williams
2023-10-25 06:37:46 -05:00
parent 760d239d0c
commit 32d863f624

View File

@@ -52,9 +52,11 @@ class DistributedJobManager:
parent_id, hostname = render_job.parent.split('@')[0], render_job.parent.split('@')[-1] parent_id, hostname = render_job.parent.split('@')[0], render_job.parent.split('@')[-1]
RenderServerProxy(hostname).notify_parent_of_status_change(parent_id=parent_id, subjob=render_job) RenderServerProxy(hostname).notify_parent_of_status_change(parent_id=parent_id, subjob=render_job)
elif render_job.children and new_status == RenderStatus.CANCELLED: # handle cancelling all the children
# todo: handle cancelling all the children elif render_job.children and new_status in [RenderStatus.CANCELLED, RenderStatus.ERROR]:
pass for child in render_job.children:
child_id, hostname = child.split('@')
RenderServerProxy(hostname).cancel_job(child_id, confirm=True)
# UI Notifications # UI Notifications
if new_status == RenderStatus.COMPLETED: if new_status == RenderStatus.COMPLETED: