Safefy: Updated Admin::AccountDeletionWorker to match AccountDeletionWorker (#37577)

This commit is contained in:
Shlee authored and GitHub committed 2026-01-22 16:01:44 +00:00
1 parent 3806d15d99
commit 1809048105
2 files changed
+5 -2

No files matched your search

+4 -1
View File
@@ -6,7 +6,10 @@ class Admin::AccountDeletionWorker
sidekiq_options queue: 'pull', lock: :until_executed, lock_ttl: 1.week.to_i
def perform(account_id)
DeleteAccountService.new.call(Account.find(account_id), reserve_username: true, reserve_email: true)
delete_account = Account.find(account_id)
return unless delete_account.unavailable?
DeleteAccountService.new.call(delete_account, reserve_username: true, reserve_email: true)
rescue ActiveRecord::RecordNotFound
true
end
@@ -6,7 +6,7 @@ RSpec.describe Admin::AccountDeletionWorker do
let(:worker) { described_class.new }
describe 'perform' do
let(:account) { Fabricate(:account) }
let(:account) { Fabricate(:account, suspended: true) }
let(:service) { instance_double(DeleteAccountService, call: true) }
it 'calls delete account service' do