Class: Toro::Middleware::Server::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/toro/middleware/server/error.rb

Instance Method Summary collapse

Instance Method Details

#call(job, worker) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# 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