add thread_safe true to redis initialization because resque does it too now

This commit is contained in:
Jonne Haß 2012-09-12 22:17:14 +02:00
parent 98c9862b19
commit 70a9218ea5

View file

@ -5,11 +5,16 @@ Resque::Plugins::Timeout.timeout = 300
if !AppConfig.single_process_mode?
if redis_to_go = ENV["REDISTOGO_URL"]
uri = URI.parse(redis_to_go)
Resque.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
redis_options = { :host => uri.host, :port => uri.port,
:passsword => uri.password }
elsif ENV['RAILS_ENV']== 'integration2'
Resque.redis = Redis.new(:host => 'localhost', :port => 6380)
redis_options = { :host => 'localhost', :port => 6380 }
elsif AppConfig[:redis_url]
Resque.redis = Redis.new(:host => AppConfig[:redis_url], :port => 6379)
redis_options = { :url => AppConfig[:redis_url], :port => 6379 }
end
if redis_options
Resque.redis = Redis.new(redis_options.merge(:thread_safe => true))
end
end