diff options
-rw-r--r-- | config/initializers/7_cache_settings.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/config/initializers/7_cache_settings.rb b/config/initializers/7_cache_settings.rb index 7dbaf2e1c9e..ce7e8c5a650 100644 --- a/config/initializers/7_cache_settings.rb +++ b/config/initializers/7_cache_settings.rb @@ -1,14 +1,14 @@ redis_config_file = Rails.root.join('config', 'resque.yml') -resque_url = if File.exists?(redis_config_file) - YAML.load_file(redis_config_file)[Rails.env] - else - "redis://localhost:6379" - end +redis_url_string = if File.exists?(redis_config_file) + YAML.load_file(redis_config_file)[Rails.env] + else + "redis://localhost:6379" + end # Redis::Store does not handle Unix sockets well, so let's do it for them -redis_config_hash = Redis::Store::Factory.extract_host_options_from_uri(resque_url) -redis_uri = URI.parse(resque_url) +redis_config_hash = Redis::Store::Factory.extract_host_options_from_uri(redis_url_string) +redis_uri = URI.parse(redis_url_string) if redis_uri.scheme == 'unix' redis_config_hash[:path] = redis_uri.path end |