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
e7a11ec3
Commit
e7a11ec3
authored
8 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #9607: update observation stoptime on abort
parent
ecdc7403
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py
+7
-5
7 additions, 5 deletions
...urceAssignment/OTDBtoRATaskStatusPropagator/propagator.py
with
7 additions
and
5 deletions
SAS/ResourceAssignment/OTDBtoRATaskStatusPropagator/propagator.py
+
7
−
5
View file @
e7a11ec3
...
@@ -137,9 +137,12 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
...
@@ -137,9 +137,12 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
def
onObservationCompleting
(
self
,
treeId
,
modificationTime
):
def
onObservationCompleting
(
self
,
treeId
,
modificationTime
):
self
.
_update_radb_task_status
(
treeId
,
'
completing
'
)
self
.
_update_radb_task_status
(
treeId
,
'
completing
'
)
def
_updateStopTime
(
self
,
treeId
):
def
_updateStopTime
(
self
,
treeId
,
only_pipelines
=
False
):
radb_task
=
self
.
radb
.
getTask
(
otdb_id
=
treeId
)
radb_task
=
self
.
radb
.
getTask
(
otdb_id
=
treeId
)
if
radb_task
and
radb_task
[
'
type
'
]
==
'
pipeline
'
:
if
radb_task
:
if
only_pipelines
and
radb_task
[
'
type
'
]
!=
'
pipeline
'
:
return
otdb_task
=
self
.
otdb
.
taskGetTreeInfo
(
otdb_id
=
treeId
)
otdb_task
=
self
.
otdb
.
taskGetTreeInfo
(
otdb_id
=
treeId
)
if
otdb_task
and
(
otdb_task
[
'
starttime
'
]
!=
radb_task
[
'
starttime
'
]
or
otdb_task
[
'
stoptime
'
]
!=
radb_task
[
'
endtime
'
]):
if
otdb_task
and
(
otdb_task
[
'
starttime
'
]
!=
radb_task
[
'
starttime
'
]
or
otdb_task
[
'
stoptime
'
]
!=
radb_task
[
'
endtime
'
]):
new_endtime
=
otdb_task
[
'
stoptime
'
]
new_endtime
=
otdb_task
[
'
stoptime
'
]
...
@@ -152,14 +155,13 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
...
@@ -152,14 +155,13 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
# otdb adjusts stoptime when finishing,
# otdb adjusts stoptime when finishing,
# reflect that in radb for pipelines
# reflect that in radb for pipelines
self
.
_updateStopTime
(
treeId
)
self
.
_updateStopTime
(
treeId
,
only_pipelines
=
True
)
def
onObservationAborted
(
self
,
treeId
,
modificationTime
):
def
onObservationAborted
(
self
,
treeId
,
modificationTime
):
self
.
_update_radb_task_status
(
treeId
,
'
aborted
'
)
self
.
_update_radb_task_status
(
treeId
,
'
aborted
'
)
# otdb adjusts stoptime when aborted,
# otdb adjusts stoptime when aborted,
# reflect that in radb for pipelines
self
.
_updateStopTime
(
treeId
,
only_pipelines
=
False
)
self
.
_updateStopTime
(
treeId
)
def
main
():
def
main
():
# Check the invocation arguments
# Check the invocation arguments
...
...
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