Commit 68b119f62f572048a9ec967d6e3280c0483f2753
Exists in
master
and in
4 other branches
Merge pull request #2022 from simonoff/master
Resque must be running in the own namespace
Showing
1 changed file
with
3 additions
and
5 deletions
Show diff stats
config/initializers/4_resque.rb
1 | # Custom Redis configuration | 1 | # Custom Redis configuration |
2 | -rails_root = ENV['RAILS_ROOT'] || File.dirname(__FILE__) + '/../..' | ||
3 | -rails_env = ENV['RAILS_ENV'] || 'development' | ||
4 | -config_file = File.join(rails_root, 'config', 'resque.yml') | 2 | +config_file = Rails.root.join('config', 'resque.yml') |
5 | 3 | ||
6 | if File.exists?(config_file) | 4 | if File.exists?(config_file) |
7 | resque_config = YAML.load_file(config_file) | 5 | resque_config = YAML.load_file(config_file) |
8 | - Resque.redis = resque_config[rails_env] | 6 | + Resque.redis = resque_config[Rails.env] |
9 | end | 7 | end |
10 | - | 8 | +Resque.redis.namespace = 'resque:gitlab' |
11 | # Queues | 9 | # Queues |
12 | Resque.watch_queue(PostReceive.instance_variable_get("@queue")) | 10 | Resque.watch_queue(PostReceive.instance_variable_get("@queue")) |
13 | 11 |