Fix N+1 in tootctl search deploy
(#26710)
This commit is contained in:
parent
ae6cf33321
commit
c0605747ad
2 changed files with 8 additions and 17 deletions
|
@ -14,7 +14,7 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
|
|||
scope.find_in_batches(batch_size: @batch_size) do |tmp|
|
||||
in_work_unit(tmp.map(&:status_id)) do |status_ids|
|
||||
bulk = ActiveRecord::Base.connection_pool.with_connection do
|
||||
Chewy::Index::Import::BulkBuilder.new(index, to_index: Status.includes(:media_attachments, :preloadable_poll).where(id: status_ids)).bulk_body
|
||||
Chewy::Index::Import::BulkBuilder.new(index, to_index: Status.includes(:media_attachments, :preloadable_poll, :preview_cards).where(id: status_ids)).bulk_body
|
||||
end
|
||||
|
||||
indexed = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue