Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enable switching db-id in an redis server from config

  • Loading branch information...
commit 6ed464f352f15adfbe8c3ed2fb08f78c7204b1a9 1 parent 95e760e
Masatomo Nakano authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/resque.rb
View
4 lib/resque.rb
@@ -24,8 +24,8 @@ module Resque
def redis=(server)
case server
when String
- host, port = server.split(':')
- redis = Redis.new(:host => host, :port => port, :thread_safe => true)
+ host, port, dbid = server.split(':')
+ redis = Redis.new(:host => host, :port => port, :thread_safe => true, :db=>dbid || 0)
@redis = Redis::Namespace.new(:resque, :redis => redis)
when Redis
@redis = Redis::Namespace.new(:resque, :redis => server)
Please sign in to comment.
Something went wrong with that request. Please try again.