From 3a3ee5e04aa0ce1d90d07644f9a3b32974f3b84a Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Thu, 23 May 2024 15:42:21 -0700 Subject: [PATCH] DEV: replace .each with .find_each for paginated queries (#27159) Large batches of reviewables may require paginated queries. --- app/jobs/scheduled/auto_queue_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)