lib/sidekiq.rb in sidekiq-2.6.5 vs lib/sidekiq.rb in sidekiq-2.7.0
- old
+ new
@@ -21,10 +21,11 @@
:queues => [],
:concurrency => 25,
:require => '.',
:environment => nil,
:timeout => 8,
+ :profile => false,
}
def self.options
@options ||= DEFAULTS.dup
end
@@ -59,17 +60,18 @@
def self.server?
defined?(Sidekiq::CLI)
end
def self.redis(&block)
- @redis ||= Sidekiq::RedisConnection.create
raise ArgumentError, "requires a block" if !block
+ @redis ||= Sidekiq::RedisConnection.create
@redis.with(&block)
end
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
raise ArgumentError, "redis= requires a Hash or ConnectionPool"
end