mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 19:38:24 +00:00
00a9369ca2
In a large forum with millions of users and millions of user_fields updating the list of dropdown user field options will result in a 502 now due to the large number of fields. This commit moves the indexing into a job.
11 lines
279 B
Ruby
11 lines
279 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Jobs::IndexUserFieldsForSearch < Jobs::Base
|
|
def execute(args)
|
|
user_field_id = args[:user_field_id]
|
|
SearchIndexer.queue_users_reindex(
|
|
UserCustomField.where(name: "user_field_#{user_field_id}").pluck(:user_id),
|
|
)
|
|
end
|
|
end
|