mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Fix comments & straighten up conditional
This commit is contained in:
parent
6b96a095fd
commit
05a8ab4d5a
1 changed files with 6 additions and 6 deletions
|
@ -28,7 +28,7 @@ module Sidekiq
|
|||
# Configuration for Sidekiq server, use like:
|
||||
#
|
||||
# Sidekiq.configure_server do |config|
|
||||
# config.redis = Sidekiq::RedisConnection.create(:namespace => 'myapp', :size => 25, :url => 'redis://myhost:8877/mydb')
|
||||
# config.redis = { :namespace => 'myapp', :size => 25, :url => 'redis://myhost:8877/mydb' }
|
||||
# config.server_middleware do |chain|
|
||||
# chain.add MyServerHook
|
||||
# end
|
||||
|
@ -41,7 +41,7 @@ module Sidekiq
|
|||
# Configuration for Sidekiq client, use like:
|
||||
#
|
||||
# Sidekiq.configure_client do |config|
|
||||
# config.redis = Sidekiq::RedisConnection.create(:namespace => 'myapp', :size => 1, :url => 'redis://myhost:8877/mydb')
|
||||
# config.redis = { :namespace => 'myapp', :size => 1, :url => 'redis://myhost:8877/mydb' }
|
||||
# end
|
||||
def self.configure_client
|
||||
yield self unless server?
|
||||
|
@ -56,16 +56,16 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def self.redis=(hash)
|
||||
if !hash.is_a?(Hash)
|
||||
@redis = if hash.is_a?(Hash)
|
||||
RedisConnection.create(hash)
|
||||
else
|
||||
puts "*****************************************************
|
||||
Sidekiq.redis now takes a Hash:
|
||||
old: Sidekiq.redis = Sidekiq::RedisConnection.create(:url => 'redis://foo.com', :namespace => 'abc', :size => 12)
|
||||
new: Sidekiq.redis = { :url => 'redis://foo.com', :namespace => 'xyz', :size => 12 }
|
||||
Called from #{caller[0]}
|
||||
*****************************************************"
|
||||
@redis = hash
|
||||
else
|
||||
@redis = RedisConnection.create(hash)
|
||||
hash
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue