Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor fixes to Memcache.init

  • Loading branch information...
commit d7c648710c3128a3c99ea23383622964f238caff 1 parent 5c9a881
@ninjudd authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/memcache.rb
View
6 lib/memcache.rb
@@ -346,7 +346,7 @@ def []=(key, value)
end
def self.init(yaml_file = nil)
- yaml_file = File.join(Rails.root, 'config', 'memcached.yml')
+ yaml_file ||= File.join(Rails.root, 'config', 'memcached.yml')
if File.exists?(yaml_file)
yaml = YAML.load_file(yaml_file)
@@ -360,7 +360,9 @@ def self.init(yaml_file = nil)
else
config.each do |connection, opts|
opts = defaults.merge(opts.symbolize_keys)
- Memcache.pool[connection] = Memcache.new(opts)
+ if not opts.empty? and not opts[:disabled]
+ Memcache.pool[connection] = Memcache.new(opts)
+ end
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.