class LIBIS::Workflow::Tasks::Analyzer

Public Instance Methods

default_options() click to toggle source
# File lib/libis/workflow/tasks/analyzer.rb, line 11
def default_options
  { quiet: true, allways_run: true }
end
run(item) click to toggle source
# File lib/libis/workflow/tasks/analyzer.rb, line 15
def run(item)

  item.properties[:ingest_failed] = item.failed?

  item.log_history.each do |log|
    level = log[:severity]
    item.summary[level] ||= 0
    item.summary[level] += 1
  end

  if item.respond_to? :each
    item.each do |i|
      run i
      i.summary.each do |level, count|
        item.summary[level] ||= 0
        item.summary[level] += (count || 0)
      end
    end
  end

  item.save

end