Skip to content
Snippets Groups Projects
Commit 7ed3fe8f authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-2836: schedule new related units right away

parent 257b66a8
No related branches found
No related tags found
No related merge requests found
......@@ -1047,6 +1047,15 @@ class TMSSDynamicSchedulingMessageHandler(TMSSEventMessageHandler):
if scheduling_unit.project.project_state.value != models.ProjectState.Choices.ACTIVE.value:
mark_independent_subtasks_in_scheduling_unit_blueprint_as_unschedulable(scheduling_unit, reason="project is not active")
try:
# if this is a new unit, and it is related to another one, then scheduling it right away.
if scheduling_unit_blueprint.scheduling_constraints_template.name == "relational":
related_unit_id = scheduling_unit_blueprint.scheduling_constraints_doc.get('other', -1)
related_unit = models.SchedulingUnitBlueprint.objects.get(id=related_unit_id)
self.scheduler.try_schedule_relational_units(related_unit)
except Exception as e:
logger.error(str(e))
# trigger next schedule computation
self.scheduler.trigger()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment