From bfed07ee20d5df75e444994912edda48839acbac Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 18 Sep 2012 21:45:09 -0400 Subject: [PATCH] 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