0
0
Fork 0

Fix “Scoped order is ignored, it's forced to be batch order.” warnings (#26793)

This commit is contained in:
Claire 2023-09-05 15:37:23 +02:00 committed by GitHub
parent f80f426c57
commit cab4cbfa5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 25 additions and 22 deletions

View file

@ -262,7 +262,7 @@ class FeedManager
add_to_feed(:home, account.id, status, aggregate_reblogs: aggregate)
end
account.following.includes(:account_stat).find_each do |target_account|
account.following.includes(:account_stat).reorder(nil).find_each do |target_account|
if redis.zcard(timeline_key) >= limit
oldest_home_score = redis.zrange(timeline_key, 0, 0, with_scores: true).first.last.to_i
last_status_score = Mastodon::Snowflake.id_at(target_account.last_status_at)

View file

@ -27,6 +27,6 @@ class Importer::PublicStatusesIndexImporter < Importer::BaseImporter
end
def scope
Status.indexable
Status.indexable.reorder(nil)
end
end

View file

@ -11,7 +11,7 @@ class Importer::StatusesIndexImporter < Importer::BaseImporter
# from a different scope to avoid indexing them multiple times, but that
# could end up being a very large array
scope.find_in_batches(batch_size: @batch_size) do |tmp|
scope.reorder(nil).find_in_batches(batch_size: @batch_size) do |tmp|
in_work_unit(tmp.map(&:status_id)) do |status_ids|
deleted = 0