mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
MemCacheStore#write uses add by default and set if :force => true
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8765 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
e59de6046c
commit
601222f294
1 changed files with 5 additions and 2 deletions
|
@ -20,9 +20,12 @@ module ActiveSupport
|
|||
nil
|
||||
end
|
||||
|
||||
def write(key, value, options = nil)
|
||||
# Set key = value if key isn't already set. Pass :force => true
|
||||
# to unconditionally set key = value.
|
||||
def write(key, value, options = {})
|
||||
super
|
||||
@data.set(key, value, expires_in(options), raw?(options))
|
||||
method = options[:force] ? :set : :add
|
||||
@data.send(method, key, value, expires_in(options), raw?(options))
|
||||
rescue MemCache::MemCacheError => e
|
||||
logger.error("MemCacheError (#{e}): #{e.message}")
|
||||
nil
|
||||
|
|
Loading…
Reference in a new issue