X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4d629923847cac25ed6bdaf5c96e1f33a1a8e0c8..a5f005b1b1175771ea708daee632a76f502eb9e6:/apps/workbench/app/helpers/pipeline_instances_helper.rb diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb index bb0ff74c34..7b6fb72763 100644 --- a/apps/workbench/app/helpers/pipeline_instances_helper.rb +++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb @@ -22,6 +22,26 @@ module PipelineInstancesHelper pj end + def pipeline_log_history(job_uuids) + results = [] + + log_history = Log.where(event_type: 'stderr', + object_uuid: job_uuids).order('id DESC') + if !log_history.results.empty? + 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 + end protected @@ -30,7 +50,6 @@ module PipelineInstancesHelper i = -1 object.components.each do |cname, c| - puts cname, c i += 1 pj = {index: i, name: cname} pj[:job] = c[:job].is_a?(Hash) ? c[:job] : {}