1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Reduce object allocations, don't use unnecessary block form in hot path

This commit is contained in:
Mike Perham 2015-12-14 21:49:51 -08:00
parent cc4e6750e1
commit 75158785a7

View file

@ -7,11 +7,11 @@ module Sidekiq
Sidekiq::Logging.with_context(log_context(worker, item)) do
begin
start = Time.now
logger.info { "start" }
logger.info("start".freeze)
yield
logger.info { "done: #{elapsed(start)} sec" }
logger.info("done: #{elapsed(start)} sec")
rescue Exception
logger.info { "fail: #{elapsed(start)} sec" }
logger.info("fail: #{elapsed(start)} sec")
raise
end
end