diff --git a/lib/sidekiq/web_helpers.rb b/lib/sidekiq/web_helpers.rb index 657646f7..21294b0c 100644 --- a/lib/sidekiq/web_helpers.rb +++ b/lib/sidekiq/web_helpers.rb @@ -247,8 +247,10 @@ module Sidekiq end def redis_connection_and_namespace - namespace_suffix = namespace.blank? ? '' : "##{namespace}" - "#{redis_connection}#{namespace_suffix}" + @redis_connection_and_namespace ||= begin + namespace_suffix = namespace.blank? ? '' : "##{namespace}" + "#{redis_connection}#{namespace_suffix}" + end end end end