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

Task #9607: update observation stop time on completing status

parent b2179791
No related branches found
No related tags found
No related merge requests found
......@@ -137,10 +137,13 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
def onObservationCompleting(self, treeId, modificationTime):
self._update_radb_task_status(treeId, 'completing')
def _updateStopTime(self, treeId, only_pipelines=False):
# otdb adjusts stoptime when aborted,
self._updateStopTime(treeId, ['observation'])
def _updateStopTime(self, treeId, task_types=None):
radb_task = self.radb.getTask(otdb_id=treeId)
if radb_task:
if only_pipelines and radb_task['type'] != 'pipeline':
if task_types and radb_task['type'] not in task_types:
return
otdb_task = self.otdb.taskGetTreeInfo(otdb_id=treeId)
......@@ -155,13 +158,14 @@ class OTDBtoRATaskStatusPropagator(OTDBBusListener):
# otdb adjusts stoptime when finishing,
# reflect that in radb for pipelines
self._updateStopTime(treeId, only_pipelines=True)
self._updateStopTime(treeId, ['pipeline'])
def onObservationAborted(self, treeId, modificationTime):
self._update_radb_task_status(treeId, 'aborted')
# otdb adjusts stoptime when aborted,
self._updateStopTime(treeId, only_pipelines=False)
self._updateStopTime(treeId)
def main():
# Check the invocation arguments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment