DEV: Prefer defer_get_set over get/set on DistributedCache (#25967)
This commit is contained in:
parent
7aa3e15440
commit
f0baa0ddfe
|
@ -287,9 +287,7 @@ class Stylesheet::Manager
|
|||
end
|
||||
)
|
||||
|
||||
stylesheets = cache[array_cache_key]
|
||||
return stylesheets if stylesheets.present?
|
||||
|
||||
cache.defer_get_set(array_cache_key) do
|
||||
@@lock.synchronize do
|
||||
stylesheets = []
|
||||
|
||||
|
@ -329,10 +327,10 @@ class Stylesheet::Manager
|
|||
stylesheets << data
|
||||
end
|
||||
|
||||
cache.defer_set(array_cache_key, stylesheets.freeze)
|
||||
stylesheets
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def color_scheme_stylesheet_details(color_scheme_id = nil, media)
|
||||
theme_id = @theme_id || SiteSetting.default_theme_id
|
||||
|
|
Loading…
Reference in New Issue