Created
August 2, 2013 08:49
-
-
Save ogasyo/6138436 to your computer and use it in GitHub Desktop.
Rails4 で dalli が標準の MemcacheClient になっちゃった対策。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add legacy memcache session store for using KyotoTycoon with memcached protocol. | |
# Sourced from Rails 3.2 | |
# => https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/middleware/session/mem_cache_store.rb | |
# | |
require 'action_dispatch/middleware/session/abstract_store' | |
require 'rack/session/memcache' | |
module ActionDispatch | |
module Session | |
class LegacyMemCacheStore < Rack::Session::Memcache | |
include Compatibility | |
include StaleSessionCheck | |
include SessionObject | |
def initialize(app, options = {}) | |
require 'memcache' | |
options[:expire_after] ||= options[:expires] | |
super | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment