提交 13d8777b 编写于 作者: M Mike Evans

Padding expires_in by 5 minutes on dalli key write to facilitate...

Padding expires_in by 5 minutes on dalli key write to facilitate :race_condition_ttl working correctly.
上级 888a7a5b
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册