Skip to content

Commit df89630

Browse files
gjastrabdefunkt
authored andcommitted
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") => #<Redis client v2.2.2 connected to redis://localhost:6379/0 (Redis v2.2.12)>
1 parent 4d530b8 commit df89630

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,10 @@ You can also set the namespace directly using `resque-web`:
445445

446446
$ resque-web -p 8282 -N myapp
447447

448+
or set the Redis connection string if you need to do something like select a different database:
449+
450+
$ resque-web -p 8282 -r localhost:6379:2
451+
448452
### Passenger
449453

450454
Using Passenger? Resque ships with a `config.ru` you can use. See

bin/resque-web

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ Vegas::Runner.new(Resque::Server, 'resque-web', {
2020
runner.logger.info "Using Redis namespace '#{namespace}'"
2121
Resque.redis.namespace = namespace
2222
}
23+
opts.on('-r redis-connection', "--redis redis-connection", "set the Redis connection string") {|redis_conf|
24+
runner.logger.info "Using Redis connection '#{redis_conf}'"
25+
Resque.redis = redis_conf
26+
}
2327
end

0 commit comments

Comments
 (0)