diff --git a/config/application.yml.example b/config/application.yml.example index b1f8e1ebd..7ecb39998 100644 --- a/config/application.yml.example +++ b/config/application.yml.example @@ -144,6 +144,8 @@ defaults: &defaults #Hoptoad api key hoptoad_api_key: '' + #url for a remote redis, on the default port. Don't forget to restrict IP access! + redis_url: '' # Use this section to override default settings in specific environments development: <<: *defaults diff --git a/config/initializers/resque.rb b/config/initializers/resque.rb index ce88bde9f..eddb928dc 100644 --- a/config/initializers/resque.rb +++ b/config/initializers/resque.rb @@ -1,5 +1,10 @@ require 'resque' + +if !ENV['SINGLE_PROCESS'] && AppConfig[:redis_url] + Resque.redis = Redis.new(:host => AppConfig[:redis_url], :port => 6379) +end + begin if ENV['SINGLE_PROCESS'] if Rails.env == 'production'