2
0

Remove unneeded reorder(nil) conditions (#32200)

This commit is contained in:
Matt Jankowski
2024-10-02 08:26:16 -04:00
committed by GitHub
parent 4aa26eba53
commit 1f65a95421
6 changed files with 8 additions and 8 deletions

View File

@@ -4,6 +4,6 @@ class FilteredNotificationCleanupWorker
include Sidekiq::Worker
def perform(account_id, from_account_id)
Notification.where(account_id: account_id, from_account_id: from_account_id, filtered: true).reorder(nil).in_batches(order: :desc).delete_all
Notification.where(account_id: account_id, from_account_id: from_account_id, filtered: true).in_batches(order: :desc).delete_all
end
end

View File

@@ -16,7 +16,7 @@ class Scheduler::UserCleanupScheduler
private
def clean_unconfirmed_accounts!
User.unconfirmed.where(confirmation_sent_at: ..UNCONFIRMED_ACCOUNTS_MAX_AGE_DAYS.days.ago).reorder(nil).find_in_batches do |batch|
User.unconfirmed.where(confirmation_sent_at: ..UNCONFIRMED_ACCOUNTS_MAX_AGE_DAYS.days.ago).find_in_batches do |batch|
# We have to do it separately because of missing database constraints
AccountModerationNote.where(target_account_id: batch.map(&:account_id)).delete_all
Account.where(id: batch.map(&:account_id)).delete_all