mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 05:51:08 +08:00
PERF: optimise query that gathers topic tracking state
(this query runs on the front page to figure out new and unread topics)
This commit is contained in:
@ -307,7 +307,7 @@ class ApplicationController < ActionController::Base
|
||||
|
||||
def preload_current_user_data
|
||||
store_preloaded("currentUser", MultiJson.dump(CurrentUserSerializer.new(current_user, scope: guardian, root: false)))
|
||||
serializer = ActiveModel::ArraySerializer.new(TopicTrackingState.report([current_user.id]), each_serializer: TopicTrackingStateSerializer)
|
||||
serializer = ActiveModel::ArraySerializer.new(TopicTrackingState.report(current_user.id), each_serializer: TopicTrackingStateSerializer)
|
||||
store_preloaded("topicTrackingStates", MultiJson.dump(serializer))
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user