Merge remote-tracking branch 'parent/main' into upstream-20231204

This commit is contained in:
KMY 2023-12-04 12:04:52 +09:00
commit 94c2396a34
179 changed files with 1036 additions and 775 deletions

View file

@ -7,7 +7,7 @@ class AccountDeletionWorker
def perform(account_id, options = {})
account = Account.find(account_id)
return unless account.suspended?
return unless account.unavailable?
reserve_username = options.with_indifferent_access.fetch(:reserve_username, true)
skip_activitypub = options.with_indifferent_access.fetch(:skip_activitypub, false)

View file

@ -21,12 +21,12 @@ class Scheduler::SuspendedUserCleanupScheduler
def perform
return if Sidekiq::Queue.new('pull').size > MAX_PULL_SIZE
clean_suspended_accounts!
process_deletion_requests!
end
private
def clean_suspended_accounts!
def process_deletion_requests!
# This should be fine because we only process a small amount of deletion requests at once and
# `id` and `created_at` should follow the same order.
AccountDeletionRequest.reorder(id: :asc).take(MAX_DELETIONS_PER_JOB).each do |deletion_request|