diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py index 3c2973d3c34f46b15cab0930fdae20d702f40d3f..5d9a461022205af3f73b4d9f7b0767b743d31e29 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py @@ -1032,28 +1032,19 @@ def _check_stations_for_observations(subtask: Subtask, ra_spec): :param subtask: :param ra_spec: """ - - MAX_NBR_ASSIGNMENTS = 10 - - i = assigned = 0 + assigned = False with RARPC.create() as rarpc: - while not assigned and i < MAX_NBR_ASSIGNMENTS: + while not assigned: try: assigned = rarpc.do_assignment(ra_spec) - i += 0 except ScheduleException as e: - logger.error(e) + logger.exception(e) if not assigned: logger.info("Conflicts in assignment detected, checking stations in conflict and re-assign if possible") lst_stations_in_conflict = get_stations_in_conflict(subtask.id) lst_stations = determine_stations_which_can_be_assigned(subtask, lst_stations_in_conflict) ra_spec = update_specification(ra_spec, lst_stations) - # At the end still not possible to assign, give Exception. - if not assigned: - raise SubtaskSchedulingException("Cannot schedule/unschedule subtask id=%d within %d number of attempts. " - "The required resources are not (fully) available." % (subtask.pk, i)) - def get_stations_in_conflict(subtask_id): """