class Judges::Update

def one_judge(opts, fb, judge, global, options, errors)

Returns:
  • (Factbase::Churn) - How many modifications have been made

Parameters:
  • errors (Array) -- List of errors
  • options (Judges::Options) -- The options
  • global (Hash) -- Global options
  • judge (Judges::Judge) -- The judge
  • fb (Factbase) -- The factbase
  • opts (Hash) -- The command line options
def one_judge(opts, fb, judge, global, options, errors)
  local = {}
  start = Time.now
  begin
    if opts['lifetime'] && Time.now - @start > opts['lifetime']
      throw :"👎 The '#{judge.name}' judge skipped, no time left"
    end
    Timeout.timeout(opts['timeout']) do
      judge.run(fb, global, local, options)
    end
  rescue Timeout::Error, Timeout::ExitException => e
    errors << "Judge #{judge.name} stopped by timeout after #{start.ago}: #{e.message}"
    throw :"👎 The '#{judge.name}' judge timed out after #{start.ago}: #{e.message}"
  end
end