From df8963076d74c9ffb9b7e8beec5d1c8c34910370 Mon Sep 17 00:00:00 2001 From: Greg Jastrab Date: Tue, 20 Sep 2011 11:44:34 -0400 Subject: [PATCH] Adds -r flag to resque-web for redis connection -r or --redis can now be used to specify the redis connection string. TODO: A string like redis://:secret@localhost is encountering an error, even though it works in irb doing: irb> require 'redis' irb> r = Redis.connect(:url => "redis://:secret@localhost") => # --- README.markdown | 4 ++++ bin/resque-web | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README.markdown b/README.markdown index 2a920d6d3..a1668a113 100644 --- a/README.markdown +++ b/README.markdown @@ -445,6 +445,10 @@ You can also set the namespace directly using `resque-web`: $ resque-web -p 8282 -N myapp +or set the Redis connection string if you need to do something like select a different database: + + $ resque-web -p 8282 -r localhost:6379:2 + ### Passenger Using Passenger? Resque ships with a `config.ru` you can use. See diff --git a/bin/resque-web b/bin/resque-web index c2b8832e6..cea6b2925 100755 --- a/bin/resque-web +++ b/bin/resque-web @@ -20,4 +20,8 @@ Vegas::Runner.new(Resque::Server, 'resque-web', { runner.logger.info "Using Redis namespace '#{namespace}'" Resque.redis.namespace = namespace } + opts.on('-r redis-connection', "--redis redis-connection", "set the Redis connection string") {|redis_conf| + runner.logger.info "Using Redis connection '#{redis_conf}'" + Resque.redis = redis_conf + } end