From 4c77a5bfff504660103089bd0525856d08bbd4c6 Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Fri, 23 Apr 2021 12:25:24 +0200
Subject: [PATCH] TMSS-717: getSubTasksStartingInThreeMinutes includes subtasks
 in scheduled and queueing state

---
 MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc b/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc
index f4b8375d015..d094fc4a49d 100644
--- a/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc
+++ b/MAC/APL/MainCU/src/MACScheduler/TMSSBridge.cc
@@ -87,16 +87,28 @@ Json::Value TMSSBridge::getSubTasksStartingInThreeMinutes()
 
     Json::Value result;
     if(httpGETAsJson(queryStr, result))
+        LOG_INFO_STR(string("JSON data for ") << queryStr << std::endl << result.toStyledString());
+
         result = result["results"];
 
+        LOG_INFO_STR(string("JSON data for ") << queryStr << std::endl << result.toStyledString());
+
         // combine scheduled list with queuing list
         string queryStr2 = "/api/subtask/?state__value=queueing&start_time__gt=" + to_iso_extended_string(lower_limit) + "&start_time__lt=" + to_iso_extended_string(upper_limit) + "&ordering=start_time";
         Json::Value result2;
         if(httpGETAsJson(queryStr2, result2)) {
+
+            LOG_INFO_STR(string("JSON data for ") << queryStr2 << std::endl << result2.toStyledString());
+
             result2 = result2["results"];
-            result = result.append(result2);
+
+            LOG_INFO_STR(string("JSON data for ") << queryStr2 << std::endl << result2.toStyledString());
+
+            result.append(result2);
         }
 
+        LOG_INFO_STR(string("JSON data total") << std::endl << result.toStyledString());
+
         return result;
     return Json::Value("");
 }
@@ -246,6 +258,8 @@ bool TMSSBridge::httpQuery(const string& target, string &result, const string& q
     curl_global_cleanup();
 
     LOG_INFO_STR(string("[") << query_method << "] code=" << httpCode << " " << url);
+    LOG_INFO_STR(result);
+
     if (httpCode == 200) {
         return true;
     }
-- 
GitLab