DEV: replace .each with .find_each for paginated queries (#27159)

Large batches of reviewables may require paginated queries.
This commit is contained in:
Jeff Wong 2024-05-23 15:42:21 -07:00 committed by GitHub
parent f9192835a7
commit 3a3ee5e04a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ module Jobs
Reviewable Reviewable
.pending .pending
.where("created_at < ?", SiteSetting.auto_handle_queued_age.to_i.days.ago) .where("created_at < ?", SiteSetting.auto_handle_queued_age.to_i.days.ago)
.each do |reviewable| .find_each do |reviewable|
if reviewable.is_a?(ReviewableFlaggedPost) if reviewable.is_a?(ReviewableFlaggedPost)
reviewable.perform(Discourse.system_user, :ignore_and_do_nothing, expired: true) reviewable.perform(Discourse.system_user, :ignore_and_do_nothing, expired: true)
elsif reviewable.is_a?(ReviewableQueuedPost) elsif reviewable.is_a?(ReviewableQueuedPost)