# Load httpclient for SOAP support for Quova GeoIP queries
gem 'httpclient'
-# Load memcache in case we are using it
-gem 'memcached', '>= 1.4.1'
+# Load memcache client in case we are using it
+gem 'dalli'
+gem 'kgio'
# Gems useful for development
group :development do
coffee-script-source (1.6.3)
composite_primary_keys (6.0.0)
activerecord (>= 4.0.0)
+ dalli (2.6.4)
deadlock_retry (1.2.0)
dynamic_form (1.1.4)
ejs (1.1.1)
jsonify (< 0.4.0)
jwt (0.1.8)
multi_json (>= 1.5)
+ kgio (2.8.1)
libxml-ruby (2.7.0)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- memcached (1.7.0)
mime-types (1.25)
mini_portile (0.5.1)
minitest (4.7.5)
bigdecimal (~> 1.1.0)
coffee-rails (~> 4.0.0)
composite_primary_keys (>= 6.0.0)
+ dalli
deadlock_retry (>= 1.2.0)
dynamic_form
ejs
jquery-rails
json
jsonify-rails
+ kgio
libxml-ruby (>= 2.0.5)
- memcached (>= 1.4.1)
minitest (~> 4.7.0)
open_id_authentication (>= 1.1.0)
openstreetmap-i18n-js (>= 3.0.0.rc5.2)
# Use a different cache store in production.
if defined?(MEMCACHE_SERVERS)
- config.cache_store = :mem_cache_store, MemCache.new(:namespace => "rails:cache", :no_block => true, :buffer_requests => true, :noreply => true)
+ config.cache_store = :mem_cache_store, MEMCACHE_SERVERS, { :namespace => "rails:cache" }
end
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
if defined?(MEMCACHE_SERVERS)
require "openid/store/memcache"
- OpenIdAuthentication.store = OpenID::Store::Memcache.new(MemCache.new(:namespace => "rails", :string_return_types => true))
+ OpenIdAuthentication.store = OpenID::Store::Memcache.new(Dalli::Client.new(MEMCACHE_SERVERS, :namespace => "rails"))
else
OpenIdAuthentication.store = :file
end
# Be sure to restart your server when you modify this file.
if defined?(MEMCACHE_SERVERS)
- cache = MemCache.new(:namespace => "rails:session", :string_return_types => true)
-
- OpenStreetMap::Application.config.session_store :mem_cache_store, :cache => cache, :key => "_osm_session"
+ OpenStreetMap::Application.config.session_store :mem_cache_store, :memcache_servers => MEMCACHE_SERVERS, :namespace => "rails:session", :key => "_osm_session"
else
OpenStreetMap::Application.config.session_store :cache_store, :key => '_osm_session'
end
+++ /dev/null
-class MemCache < Memcached::Rails
- DEFAULT_OPTIONS = Memcached::DEFAULTS.merge(Memcached::Rails::DEFAULTS)
-
- MemCacheError = Memcached::Error
-
- @@connections = []
-
- def initialize(options = {})
- options.reverse_merge! :namespace_separator => ":"
-
- super(MEMCACHE_SERVERS, options)
-
- @@connections.push(self)
-
- ObjectSpace.define_finalizer(self, lambda { |connection|
- @@connections.remove(connection)
- })
- end
-
- def self.connections
- @@connections
- end
-end
-
-if defined?(PhusionPassenger)
- PhusionPassenger.on_event(:starting_worker_process) do |forked|
- if forked
- MemCache.connections.each { |connection| connection.reset }
- end
- end
-end