未验证 提交 f45a3f89 编写于 作者: F fatkodima 提交者: Jeremy Daer

Use Redis#mget for RedisCacheStore#fetch_multi

上级 c327f4dc
......@@ -307,6 +307,14 @@ def read_entry(key, options = nil)
end
end
def read_multi_entries(names, _options)
if mget_capable?
read_multi_mget(*names)
else
super
end
end
def read_multi_mget(*names)
options = names.extract_options!
options = merged_options(options)
......
......@@ -109,6 +109,14 @@ class RedisCacheStoreCommonBehaviorTest < StoreTest
include CacheIncrementDecrementBehavior
include CacheInstrumentationBehavior
include AutoloadingCacheBehavior
def test_fetch_multi_uses_redis_mget
assert_called(@cache.redis, :mget, returns: []) do
@cache.fetch_multi("a", "b", "c") do |key|
key * 2
end
end
end
end
# Separate test class so we can omit the namespace which causes expected,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册