0
0
Fork 0

Add Account#unavailable? and Account#permanently_unavailable? aliases (#28053)

This commit is contained in:
Claire 2023-11-30 16:43:26 +01:00 committed by GitHub
parent 35deaaf90b
commit 963354978a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 57 additions and 58 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|