Class: Sidekiq::JobLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/job_logger.rb

Instance Method Summary collapse

Instance Method Details

#call(item, queue) ⇒ Object


5
6
7
8
9
10
11
12
13
# File 'lib/sidekiq/job_logger.rb', line 5

def call(item, queue)
  start = Time.now
  logger.info("start")
  yield
  logger.info("done: #{elapsed(start)} sec")
rescue Exception
  logger.info("fail: #{elapsed(start)} sec")
  raise
end