Class: Sidekiq::Middleware::Server::Stats::ResqueLike

Inherits:
Object
  • Object
show all
Includes:
ResqueStatus
Defined in:
lib/sidekiq-resque_status/middleware/server/resque_like.rb

Constant Summary

Constants included from ResqueStatus

ResqueStatus::VERSION

Instance Method Summary collapse

Methods included from ResqueStatus

#enqueue_job, #job_completed, #job_failed, #job_in_progress

Instance Method Details

#call(worker, msg, queue) ⇒ Object

Update the status, and add other information (such as the job description) into redis



9
10
11
12
13
14
15
16
17
18
# File 'lib/sidekiq-resque_status/middleware/server/resque_like.rb', line 9

def call(worker, msg, queue)
  begin
    job_in_progress(worker, msg, queue)
    start_time = Time.now
    yield
    job_completed(worker, msg, queue, Time.now-start_time)
  rescue Exception => error
    job_failed(worker, msg, queue, error)
  end
end