mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22193 from grosser/grosser/multi
call local_cache 1 time instead of 3 times
This commit is contained in:
commit
f036eacd6c
1 changed files with 3 additions and 3 deletions
|
@ -102,10 +102,10 @@ module ActiveSupport
|
||||||
|
|
||||||
protected
|
protected
|
||||||
def read_entry(key, options) # :nodoc:
|
def read_entry(key, options) # :nodoc:
|
||||||
if local_cache
|
if cache = local_cache
|
||||||
local_cache.fetch(key) do
|
cache.fetch(key) do
|
||||||
entry = super
|
entry = super
|
||||||
local_cache.write_entry(key, entry, options)
|
cache.write_entry(key, entry, options)
|
||||||
entry
|
entry
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue