Skip to content

A platform for community discussion. Free, open, simple.

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

Jeff Wong3a3ee5e04aa0
diff --git a/app/jobs/scheduled/auto_queue_handler.rb b/app/jobs/scheduled/auto_queue_handler.rb
index 7cb7ca54b62..01f8cb79c25 100644
--- a/app/jobs/scheduled/auto_queue_handler.rb
+++ b/app/jobs/scheduled/auto_queue_handler.rb
@@ -12,7 +12,7 @@ module Jobs
Reviewable
.pending
.where("created_at < ?", SiteSetting.auto_handle_queued_age.to_i.days.ago)
- .each do |reviewable|
+ .find_each do |reviewable|
if reviewable.is_a?(ReviewableFlaggedPost)
reviewable.perform(Discourse.system_user, :ignore_and_do_nothing, expired: true)
elsif reviewable.is_a?(ReviewableQueuedPost)