mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Lazy require memcache for session middleware
This commit is contained in:
parent
fff3f0ae0c
commit
a01bf41c61
1 changed files with 37 additions and 42 deletions
|
@ -1,11 +1,9 @@
|
||||||
require "active_support/core_ext/kernel/requires"
|
module ActionDispatch
|
||||||
begin
|
|
||||||
require_library_or_gem 'memcache'
|
|
||||||
|
|
||||||
module ActionDispatch
|
|
||||||
module Session
|
module Session
|
||||||
class MemCacheStore < AbstractStore
|
class MemCacheStore < AbstractStore
|
||||||
def initialize(app, options = {})
|
def initialize(app, options = {})
|
||||||
|
require 'memcache'
|
||||||
|
|
||||||
# Support old :expires option
|
# Support old :expires option
|
||||||
options[:expire_after] ||= options[:expires]
|
options[:expire_after] ||= options[:expires]
|
||||||
|
|
||||||
|
@ -46,7 +44,4 @@ begin
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
rescue LoadError
|
|
||||||
# MemCache wasn't available so neither can the store be
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue