Unicorn redis config fix 2

jamesperet 9 年 前
コミット
9fba4b3cd1
共有1 個のファイルを変更した3 個の追加1 個の削除を含む
  1. 3 1
      config/unicorn.rb

+ 3 - 1
config/unicorn.rb

@@ -28,7 +28,9 @@ after_fork do |server, worker|
28 28
  
29 29
   # If you are using Redis but not Resque, change this
30 30
   if defined?(Resque)
31
-    Resque.redis = ENV['REDISTOGO_URL']
31
+    uri = URI.parse(ENV["REDISTOGO_URL"])
32
+    redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
33
+    Resque.redis = redis
32 34
     Rails.logger.info('Connected to Redis')
33 35
   end
34 36
 end