mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 04:03:57 -06:00
fix: retrieve posts in order by id.
so we can find starting and ending id of the batch.
This commit is contained in:
parent
ce8d30f667
commit
48cedf3ebe
@ -399,7 +399,7 @@ task 'posts:missing_uploads' => :environment do
|
||||
PostCustomField.where(name: Post::MISSING_UPLOADS).delete_all
|
||||
count = 0
|
||||
|
||||
Post.have_uploads.select(:id, :cooked).find_in_batches do |posts|
|
||||
Post.have_uploads.order(:id).select(:id, :cooked).find_in_batches do |posts|
|
||||
ids = posts.pluck(:id)
|
||||
sha1s = Upload.joins(:post_uploads).where("post_uploads.post_id >= ? AND post_uploads.post_id <= ?", ids.min, ids.max).pluck(:sha1)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user