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

minor fix

parent ca66eae3
No related branches found
No related tags found
No related merge requests found
......@@ -483,6 +483,7 @@ def can_run_at(scheduling_unit: models.SchedulingUnitBlueprint, proposed_start_t
'''determine if the given scheduling_unit can run withing the given timewindow evaluating all constraints from the "constraints" version 1 template
:param raise_if_interruped: a callable function which raises under an externally set condition (an 'interrupt' flag was set). This function is/can_be used to interrupt a long-running scheduling call to do an early exit and start a new scheduling call. Default used function is noop (no-operation), thus no interruptable behaviour.
'''
try:
if gridder is None:
gridder = Gridder()
......@@ -499,6 +500,9 @@ def can_run_at(scheduling_unit: models.SchedulingUnitBlueprint, proposed_start_t
return False
return True
except Exception as e:
logger.error("can_run_at: unit id=%s proposed_start_time='%s' %s", scheduling_unit.id, proposed_start_time, e)
return False
def can_run_before(scheduling_unit: models.SchedulingUnitBlueprint, proposed_start_time: datetime, gridder: Gridder) -> bool:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment