0
0
Fork 0

Fix removing allowed domains being done synchronously (#14302)

* Fix removing allowed domains being done synchronously

* Add tests
This commit is contained in:
ThibG 2020-07-15 21:08:19 +02:00 committed by GitHub
parent bfed7dd5f3
commit d658af7ff8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 84 additions and 3 deletions

View file

@ -12,8 +12,7 @@ class UnallowDomainService < BaseService
private
def suspend_accounts!(domain)
Account.where(domain: domain).find_each do |account|
SuspendAccountService.new.call(account, reserve_username: false)
end
Account.where(domain: domain).in_batches.update_all(suspended_at: Time.now.utc)
AfterUnallowDomainWorker.perform_async(domain)
end
end