Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support redis:// format. Closes #133

  • Loading branch information...
commit 8f5ff340b2cc708f1487aed20db5e64df1e4d5fe 1 parent d75e0d6
@defunkt defunkt authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 lib/resque.rb
View
11 lib/resque.rb
@@ -30,9 +30,14 @@ module Resque
# or `Redis::Namespace`.
def redis=(server)
if server.respond_to? :split
- host, port, db = server.split(':')
- redis = Redis.new(:host => host, :port => port,
- :thread_safe => true, :db => db)
+ if server =~ /redis\:\/\//
+ redis = Redis.connect(:url => server)
+ else
+ host, port, db = server.split(':')
+ redis = Redis.new(:host => host, :port => port,
+ :thread_safe => true, :db => db)
+ end
+
@redis = Redis::Namespace.new(:resque, :redis => redis)
elsif server.respond_to? :namespace=
@redis = server
Please sign in to comment.
Something went wrong with that request. Please try again.