make redis url configurable via app config
This commit is contained in:
parent
fd6981c3d2
commit
faa44c0a91
2 changed files with 7 additions and 0 deletions
|
|
@ -144,6 +144,8 @@ defaults: &defaults
|
||||||
#Hoptoad api key
|
#Hoptoad api key
|
||||||
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
|
# Use this section to override default settings in specific environments
|
||||||
development:
|
development:
|
||||||
<<: *defaults
|
<<: *defaults
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
require 'resque'
|
require 'resque'
|
||||||
|
|
||||||
|
|
||||||
|
if !ENV['SINGLE_PROCESS'] && AppConfig[:redis_url]
|
||||||
|
Resque.redis = Redis.new(:host => AppConfig[:redis_url], :port => 6379)
|
||||||
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if ENV['SINGLE_PROCESS']
|
if ENV['SINGLE_PROCESS']
|
||||||
if Rails.env == 'production'
|
if Rails.env == 'production'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue