From bfed07ee20d5df75e444994912edda48839acbac Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 18 Sep 2012 21:45:09 -0400 Subject: [PATCH 1/2] Add an initializer to allow custom Resque configs --- config/initializers/resque.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 config/initializers/resque.rb diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb new file mode 100644 index 00000000..b333ceee --- /dev/null +++ b/config/initializers/resque.rb @@ -0,0 +1,8 @@ +rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' +rails_env = ENV['RAILS_ENV'] || 'development' +config_file = File.join(rails_root, 'config', 'resque.yml') + +if File.exists?(config_file) + resque_config = YAML.load_file(config_file) + Resque.redis = resque_config[rails_env] +end From 259ca982da2f2962773ef797fabe6d6641689f5e Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 18 Sep 2012 21:53:27 -0400 Subject: [PATCH 2/2] Add docs for customizing Redis, add example file --- config/resque.yml.example | 3 +++ doc/installation.md | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 config/resque.yml.example diff --git a/config/resque.yml.example b/config/resque.yml.example new file mode 100644 index 00000000..cd3d4874 --- /dev/null +++ b/config/resque.yml.example @@ -0,0 +1,3 @@ +development: localhost:6379 +test: localhost:6379 +production: redis.example.com:6379 diff --git a/doc/installation.md b/doc/installation.md index 345d801d..865cde3c 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -251,6 +251,14 @@ You can login via web using admin generated with setup: # if you run this as root /home/gitlab/gitlab/tmp/pids/resque_worker.pid will be owned by root # causing the resque worker not to start via init script on next boot/service restart +## Customizing Resque's Redis connection + +If you'd like Resque to connect to a Redis server on a non-standard port or on +a different host, you can configure its connection string in the +**config/resque.yml** file: + + production: redis.example.com:6379 + **Ok - we have a working application now. ** **But keep going - there are some things that should be done ** @@ -276,7 +284,6 @@ You can login via web using admin generated with setup: # of the host serving GitLab. sudo vim /etc/nginx/sites-enabled/gitlab - # Restart nginx: /etc/init.d/nginx restart