mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Clean up namespace lookup, #651
This commit is contained in:
parent
35c562f9c4
commit
cea55197e7
4 changed files with 7 additions and 5 deletions
|
@ -69,6 +69,7 @@ module Sidekiq
|
|||
def self.redis=(hash)
|
||||
if hash.is_a?(Hash)
|
||||
@redis = RedisConnection.create(hash)
|
||||
options[:namespace] = hash[:namespace]
|
||||
elsif hash.is_a?(ConnectionPool)
|
||||
@redis = hash
|
||||
else
|
||||
|
|
|
@ -50,7 +50,7 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def namespace
|
||||
Sidekiq.redis { |conn| Sidekiq.options[:namespace] || 'default' }
|
||||
Sidekiq.options[:namespace]
|
||||
end
|
||||
|
||||
def root_path
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Sidekiq.configure_client do |config|
|
||||
config.redis = { :size => 2 }
|
||||
config.redis = { :size => 2, :namespace => 'foo' }
|
||||
end
|
||||
Sidekiq.configure_server do |config|
|
||||
config.redis = { :size => 25 }
|
||||
config.redis = { :size => 25, :namespace => 'foo' }
|
||||
end
|
||||
|
|
|
@ -24,8 +24,9 @@ html
|
|||
p.navbar-text Redis: #{location}
|
||||
li
|
||||
p.navbar-text Time: #{Time.now.utc.strftime('%H:%M:%S UTC')}
|
||||
li
|
||||
p.navbar-text Namespace: #{namespace}
|
||||
- if namespace
|
||||
li
|
||||
p.navbar-text Namespace: #{namespace}
|
||||
|
||||
#page
|
||||
.container
|
||||
|
|
Loading…
Reference in a new issue