Skip to content

Commit 0b119c6

Browse files
committed
only update if needed
1 parent 3b247c7 commit 0b119c6

File tree

1 file changed

+4
-1
lines changed
  • services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler

1 file changed

+4
-1
lines changed

services/director-v2/src/simcore_service_director_v2/modules/comp_scheduler/_scheduler_base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,13 @@ async def _update_run_result_from_tasks(
209209
project_id: ProjectID,
210210
iteration: Iteration,
211211
pipeline_tasks: dict[NodeIDStr, CompTaskAtDB],
212+
current_result: RunningState,
212213
) -> RunningState:
213214
pipeline_state_from_tasks = get_pipeline_state_from_task_states(
214215
list(pipeline_tasks.values()),
215216
)
217+
if pipeline_state_from_tasks == current_result:
218+
return pipeline_state_from_tasks
216219
_logger.debug(
217220
"pipeline %s is currently in %s",
218221
f"{user_id=}_{project_id=}_{iteration=}",
@@ -672,7 +675,7 @@ async def apply(
672675

673676
# 6. Update the run result
674677
pipeline_result = await self._update_run_result_from_tasks(
675-
user_id, project_id, iteration, comp_tasks
678+
user_id, project_id, iteration, comp_tasks, comp_run.result
676679
)
677680

678681
# 7. Are we done scheduling that pipeline?

0 commit comments

Comments
 (0)