From 8bb9b962973cebf0a06e0195c29605d33b8c83ac Mon Sep 17 00:00:00 2001 From: jc00ke Date: Tue, 4 Sep 2012 09:45:35 -0700 Subject: [PATCH] Memoize info on each request --- lib/sidekiq/web.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/sidekiq/web.rb b/lib/sidekiq/web.rb index db3fc039..3318631f 100644 --- a/lib/sidekiq/web.rb +++ b/lib/sidekiq/web.rb @@ -60,12 +60,16 @@ module Sidekiq end end + def info + @info ||= Sidekiq.info + end + def processed - Sidekiq.info[:processed] + info[:processed] end def failed - Sidekiq.info[:failed] + info[:failed] end def zcard(name) @@ -77,7 +81,7 @@ module Sidekiq end def backlog - Sidekiq.info[:backlog] + info[:backlog] end def retries_with_score(score)