Merge pull request #7913 from mje113/master
MemCacheStore's move to dalli as a backend broke :race_condition_ttl support
This commit is contained in:
commit
168df24ac8
@ -132,6 +132,10 @@ def write_entry(key, entry, options) # :nodoc:
|
||||
method = options && options[:unless_exist] ? :add : :set
|
||||
value = options[:raw] ? entry.value.to_s : entry
|
||||
expires_in = options[:expires_in].to_i
|
||||
if expires_in > 0 && !options[:raw]
|
||||
# Set the memcache expire a few minutes in the future to support race condition ttls on read
|
||||
expires_in += 5.minutes
|
||||
end
|
||||
@data.send(method, escape_key(key), value, expires_in, options)
|
||||
rescue Dalli::DalliError => e
|
||||
logger.error("DalliError (#{e}): #{e.message}") if logger
|
||||
|
Loading…
Reference in New Issue
Block a user