提交 05d4b9d2 编写于 作者: B Brian Durand 提交者: Xavier Noria

Pass options in ActiveSupport::Cache::CacheStore#read_multi through to the delete_entry call.

上级 cc78a8f0
...@@ -347,7 +347,7 @@ def read_multi(*names) ...@@ -347,7 +347,7 @@ def read_multi(*names)
entry = read_entry(key, options) entry = read_entry(key, options)
if entry if entry
if entry.expired? if entry.expired?
delete_entry(key) delete_entry(key, options)
else else
results[name] = entry.value results[name] = entry.value
end end
......
...@@ -200,6 +200,14 @@ def test_read_multi ...@@ -200,6 +200,14 @@ def test_read_multi
assert_equal({"foo" => "bar", "fu" => "baz"}, @cache.read_multi('foo', 'fu')) assert_equal({"foo" => "bar", "fu" => "baz"}, @cache.read_multi('foo', 'fu'))
end end
def test_read_multi_with_expires
@cache.write('foo', 'bar', :expires_in => 0.001)
@cache.write('fu', 'baz')
@cache.write('fud', 'biz')
sleep(0.002)
assert_equal({"fu" => "baz"}, @cache.read_multi('foo', 'fu'))
end
def test_read_and_write_compressed_small_data def test_read_and_write_compressed_small_data
@cache.write('foo', 'bar', :compress => true) @cache.write('foo', 'bar', :compress => true)
raw_value = @cache.send(:read_entry, 'foo', {}).raw_value raw_value = @cache.send(:read_entry, 'foo', {}).raw_value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册