Add Account#unavailable?
and Account#permanently_unavailable?
aliases (#28053)
This commit is contained in:
parent
35deaaf90b
commit
963354978a
25 changed files with 57 additions and 58 deletions
|
@ -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)
|
||||
|
|
|
@ -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|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue