mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Defer setting of distributed cache in category.
See follow up commit for rational.
Follow-up to 8cfe203
This commit is contained in:
@@ -735,7 +735,9 @@ class Category < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def url
|
||||
@@url_cache[self.id] ||= "#{Discourse.base_path}/c/#{slug_path.join('/')}/#{self.id}"
|
||||
@@url_cache.defer_get_set(self.id) do
|
||||
"#{Discourse.base_path}/c/#{slug_path.join('/')}/#{self.id}"
|
||||
end
|
||||
end
|
||||
|
||||
def url_with_id
|
||||
|
||||
Reference in New Issue
Block a user