Commit bfed07ee20d5df75e444994912edda48839acbac

Authored by Robert Speicher
1 parent 4ecf23d2

Add an initializer to allow custom Resque configs

Showing 1 changed file with 8 additions and 0 deletions   Show diff stats
config/initializers/resque.rb 0 → 100644
... ... @@ -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
... ...