From 851cb96e750d98fa35e3323d03ebc6830d5eb3c0 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Sat, 19 Mar 2022 17:24:08 +0900 Subject: [PATCH] Fix clean_discarded_statuses (#17822) --- app/workers/scheduler/user_cleanup_scheduler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/scheduler/user_cleanup_scheduler.rb b/app/workers/scheduler/user_cleanup_scheduler.rb index 750d2127b4..d1f00c47fb 100644 --- a/app/workers/scheduler/user_cleanup_scheduler.rb +++ b/app/workers/scheduler/user_cleanup_scheduler.rb @@ -27,7 +27,7 @@ class Scheduler::UserCleanupScheduler end def clean_discarded_statuses! - Status.discarded.where('deleted_at <= ?', 30.days.ago).find_in_batches do |statuses| + Status.unscoped.discarded.where('deleted_at <= ?', 30.days.ago).find_in_batches do |statuses| RemovalWorker.push_bulk(statuses) do |status| [status.id, { 'immediate' => true }] end