method
read_multi_mget
v6.1.7.7 -
Show latest stable
- Class:
ActiveSupport::Cache::RedisCacheStore
read_multi_mget(*names)private
No documentation available.
# File activesupport/lib/active_support/cache/redis_cache_store.rb, line 361
def read_multi_mget(*names)
options = names.extract_options!
options = merged_options(options)
return {} if names == []
raw = options&.fetch(:raw, false)
keys = names.map { |name| normalize_key(name, options) }
values = failsafe(:read_multi_mget, returning: {}) do
redis.with { |c| c.mget(*keys) }
end
names.zip(values).each_with_object({}) do |(name, value), results|
if value
entry = deserialize_entry(value, raw: raw)
unless entry.nil? || entry.expired? || entry.mismatched?(normalize_version(name, options))
results[name] = entry.value
end
end
end
end