class Toro::Middleware::Server::Error

Public Instance Methods

call(job, worker) { || ... } click to toggle source
# File lib/toro/middleware/server/error.rb, line 5
def call(job, worker)
  begin
    yield
  rescue Exception => exception
    job.update_attributes(
      status: 'failed',
      finished_at: Time.now
    )
    raise exception
  end
end