Commit 6d8d32c2448cf4d321b1e3f0916b808532cd7e60
Exists in
master
and in
4 other branches
Merge pull request #1496 from tsigo/custom_redis
Add initializer for customizing Resque's Redis connection
Showing
3 changed files
with
19 additions
and
1 deletions
Show diff stats
... | ... | @@ -0,0 +1,8 @@ |
1 | +rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' | |
2 | +rails_env = ENV['RAILS_ENV'] || 'development' | |
3 | +config_file = File.join(rails_root, 'config', 'resque.yml') | |
4 | + | |
5 | +if File.exists?(config_file) | |
6 | + resque_config = YAML.load_file(config_file) | |
7 | + Resque.redis = resque_config[rails_env] | |
8 | +end | ... | ... |
doc/installation.md
... | ... | @@ -251,6 +251,14 @@ You can login via web using admin generated with setup: |
251 | 251 | # if you run this as root /home/gitlab/gitlab/tmp/pids/resque_worker.pid will be owned by root |
252 | 252 | # causing the resque worker not to start via init script on next boot/service restart |
253 | 253 | |
254 | +## Customizing Resque's Redis connection | |
255 | + | |
256 | +If you'd like Resque to connect to a Redis server on a non-standard port or on | |
257 | +a different host, you can configure its connection string in the | |
258 | +**config/resque.yml** file: | |
259 | + | |
260 | + production: redis.example.com:6379 | |
261 | + | |
254 | 262 | **Ok - we have a working application now. ** |
255 | 263 | **But keep going - there are some things that should be done ** |
256 | 264 | |
... | ... | @@ -276,7 +284,6 @@ You can login via web using admin generated with setup: |
276 | 284 | # of the host serving GitLab. |
277 | 285 | sudo vim /etc/nginx/sites-enabled/gitlab |
278 | 286 | |
279 | - | |
280 | 287 | # Restart nginx: |
281 | 288 | /etc/init.d/nginx restart |
282 | 289 | ... | ... |