Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
f0d3d83a
Commit
f0d3d83a
authored
8 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #9607: apply sane start time
parent
6ae79d40
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssigner/lib/assignment.py
+12
-6
12 additions, 6 deletions
SAS/ResourceAssignment/ResourceAssigner/lib/assignment.py
with
12 additions
and
6 deletions
SAS/ResourceAssignment/ResourceAssigner/lib/assignment.py
+
12
−
6
View file @
f0d3d83a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment