Skip to content

Commit

Permalink
depend on Backend for redis rather than Config
Browse files Browse the repository at this point in the history
  • Loading branch information
Strand McCutchen authored and steveklabnik committed Apr 18, 2013
1 parent 7cb22de commit 3989a02
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/resque.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ def self.configure
yield config
end

def backend
@backend ||= Backend.new(config.redis, Resque.logger)
end

def redis=(server)
config.redis = server
@backend = Backend.new(config.redis, Resque.logger)

@queues = Hash.new do |h,name|
h[name] = Resque::Queue.new(name, config.redis, coder)
Expand All @@ -63,7 +68,7 @@ def redis=(server)
# Returns the current Redis connection. If none has been created, will
# create a new one.
def redis
config.redis
backend.store
end

def redis_id
Expand Down

0 comments on commit 3989a02

Please sign in to comment.