mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 16:24:55 +00:00
DEV: Make banner cache work like other caches (#20811)
This commit is contained in:
parent
88004873ec
commit
7e23e6c1e8
@ -686,16 +686,15 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def banner_json
|
def banner_json
|
||||||
json = ApplicationController.banner_json_cache["json"]
|
|
||||||
return "{}" if !current_user && SiteSetting.login_required?
|
return "{}" if !current_user && SiteSetting.login_required?
|
||||||
|
|
||||||
unless json
|
ApplicationController
|
||||||
topic = Topic.where(archetype: Archetype.banner).first
|
.banner_json_cache
|
||||||
banner = topic.present? ? topic.banner : {}
|
.defer_get_set("json") do
|
||||||
ApplicationController.banner_json_cache["json"] = json = MultiJson.dump(banner)
|
topic = Topic.where(archetype: Archetype.banner).first
|
||||||
end
|
banner = topic.present? ? topic.banner : {}
|
||||||
|
MultiJson.dump(banner)
|
||||||
json
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def custom_emoji
|
def custom_emoji
|
||||||
|
Loading…
x
Reference in New Issue
Block a user