From 9b59b2cfa40e734addce66dda47c1327f79d6480 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rn=20K=C3=BCnsem=C3=B6ller?=
 <jkuensem@physik.uni-bielefeld.de>
Date: Mon, 27 Sep 2021 19:01:01 +0200
Subject: [PATCH] TMSS-159: Change subtask start/stop times to various flavors

---
 SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py
index 674eeb5d327..fa1ee8088b4 100644
--- a/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py
+++ b/SAS/TMSS/backend/src/tmss/tmssapp/subtasks.py
@@ -1774,7 +1774,7 @@ def schedule_ingest_subtask(ingest_subtask: Subtask):
     # not very relevant for ingest subtasks, but it's nice for the user to see when the ingest task was scheduled.
     # please note that an ingest subtask may idle for some time while it is in the ingest queue.
     # the actual start/stop times are set by the IngestTMSSAdapter when the subtask starts and stops.
-    ingest_subtask.scheduled_on_sky_start_time = max([pred.stop_time for pred in ingest_subtask.predecessors] + [datetime.utcnow()])
+    ingest_subtask.scheduled_on_sky_start_time = max([pred.scheduled_on_sky_stop_time for pred in ingest_subtask.predecessors] + [datetime.utcnow()])
     ingest_subtask.scheduled_on_sky_stop_time = ingest_subtask.scheduled_on_sky_start_time  + timedelta(hours=6)
 
     # step 2: link input dataproducts
@@ -1852,7 +1852,7 @@ def schedule_cleanup_subtask(cleanup_subtask: Subtask):
     # not very relevant for ingest subtasks, but it's nice for the user to see when the cleanup task was scheduled.
     # please note that an cleanup subtask may idle for some time while it is in the cleanup queue.
     # the actual start/stop times are set by the IngestTMSSAdapter when the subtask starts and stops.
-    cleanup_subtask.scheduled_on_sky_start_time = max([pred.stop_time for pred in cleanup_subtask.predecessors] + [datetime.utcnow()])
+    cleanup_subtask.scheduled_on_sky_start_time = max([pred.scheduled_on_sky_stop_time for pred in cleanup_subtask.predecessors] + [datetime.utcnow()])
     cleanup_subtask.scheduled_on_sky_stop_time = cleanup_subtask.scheduled_on_sky_start_time  + timedelta(hours=1)
 
     # step 2: link input dataproducts
-- 
GitLab