Merge branch 'master' into 2756-eventbus-in-workbench
[arvados.git] / apps / workbench / app / helpers / pipeline_instances_helper.rb
index db2a467b7e00bc2fee3675646ebd9e010bed7724..7b6fb727637fc6dc0e56fac95c303321bf050abc 100644 (file)
@@ -22,13 +22,22 @@ module PipelineInstancesHelper
     pj
   end
 
-  def pipieline_log_history(job_uuids)
+  def pipeline_log_history(job_uuids)
     results = []
 
-    log_history = Log.where(event_type: 'transient-log-entry',
-                            object_uuid: job_uuids).order('id DESC').limit(5).all
+    log_history = Log.where(event_type: 'stderr',
+                            object_uuid: job_uuids).order('id DESC')
     if !log_history.results.empty?
-      results = log_history.results.reverse
+      reversed_results = log_history.results.reverse
+      reversed_results.each do |entry|
+        if entry.andand.properties
+          properties = entry.properties
+          text = properties[:text]
+          if text
+            results = results.concat text.split("\n")
+          end
+        end
+      end
     end
 
     return results