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
ret = []
i = -1
- comp = []
-
- template = PipelineTemplate.find(@object.pipeline_template_uuid) rescue nil
- if template
- order = PipelineTemplatesHelper::sort_components(template.components)
- order.each do |k|
- if object.components[k]
- comp.push([k, object.components[k]])
- end
- end
- else
- object.components.each do |k, v|
- comp.push([k, v])
- end
- end
-
- comp.each do |cname, c|
- puts cname, c
+ object.components.each do |cname, c|
i += 1
pj = {index: i, name: cname}
pj[:job] = c[:job].is_a?(Hash) ? c[:job] : {}