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

Task #9607: apply sane start time

parent 6ae79d40
Branches
Tags
No related merge requests found
......@@ -136,12 +136,7 @@ class ResourceAssigner():
clusterName = 'CEP4' if clusterIsCEP4 else 'CEP2'
if clusterIsCEP4:
try:
startTime = datetime.strptime(mainParset.getString('Observation.startTime'), '%Y-%m-%d %H:%M:%S')
endTime = datetime.strptime(mainParset.getString('Observation.stopTime'), '%Y-%m-%d %H:%M:%S')
except ValueError:
logger.warning('cannot parse for start/end time from specification for otdb_id=%s. searching for sane defaults...', (otdb_id, ))
def applySaneStartEndTime():
startTime = datetime.utcnow() + timedelta(minutes=1)
maxPredecessorEndTime = self.getMaxPredecessorEndTime(specification_tree)
......@@ -163,6 +158,17 @@ class ResourceAssigner():
except Exception as e:
logger.error(e)
return startTime, endTime
try:
startTime = datetime.strptime(mainParset.getString('Observation.startTime'), '%Y-%m-%d %H:%M:%S')
endTime = datetime.strptime(mainParset.getString('Observation.stopTime'), '%Y-%m-%d %H:%M:%S')
if startTime < datetime.utcnow():
startTime, endTime = applySaneStartEndTime()
except ValueError:
logger.warning('cannot parse for start/end time from specification for otdb_id=%s. searching for sane defaults...', otdb_id)
startTime, endTime = applySaneStartEndTime()
try:
# fix for MoM bug introduced before NV's holiday
# MoM sets ProcessingCluster.clusterName to CEP2 even when inputxml says CEP4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment