Переглянути джерело

HUE-4331 [editor] Log call should return only the additional ones after the first call

When batch mode is on
When interface is oozie

We redisplay the full logs.
Romain Rigaux 10 роки тому
батько
коміт
a525bdfff3

+ 1 - 0
desktop/libs/notebook/src/notebook/api.py

@@ -269,6 +269,7 @@ def get_logs(request):
   response['logs'] = logs.strip()
   response['progress'] = db.progress(snippet, full_log) if snippet['status'] != 'available' and snippet['status'] != 'success' else 100
   response['jobs'] = jobs
+  response['isFullLogs'] = snippet.get('interface') == 'oozie'
   response['status'] = 0
 
   return JsonResponse(response)

+ 2 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1135,7 +1135,8 @@
             var logs = data.logs.split("\n");
             self.result.logLines += logs.length;
             var oldLogs = self.result.logs();
-            if (oldLogs === "") {
+            if (data.logs && (
+                oldLogs === "" || (self.wasBatchExecuted() && data.logs.indexOf('Unable to locate') == -1) || data.isFullLogs)) {
               self.result.logs(data.logs);
             } else {
               self.result.logs(oldLogs + "\n" + data.logs);