Add ability to purge undeliverable domains from admin interface (#16686)
* Add ability to purge undeliverable domains from admin interface * Add tests
This commit is contained in:
parent
0c17fd9109
commit
7f803c41e2
13 changed files with 121 additions and 7 deletions
10
app/services/purge_domain_service.rb
Normal file
10
app/services/purge_domain_service.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class PurgeDomainService < BaseService
|
||||
def call(domain)
|
||||
Account.remote.where(domain: domain).reorder(nil).find_each do |account|
|
||||
DeleteAccountService.new.call(account, reserve_username: false, skip_side_effects: true)
|
||||
end
|
||||
Instance.refresh
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue