Updated domains cli remoteallremote command

• Updated:
- domains cli remoteallremote command
This commit is contained in:
mgabdev 2020-11-25 16:14:23 -06:00
parent 99e5711c8b
commit 61402a29a2

View File

@ -44,19 +44,23 @@ module GabSocial
def deleteallremote
dry_run = options[:dry_run] ? ' (DRY RUN)' : ''
Account.remote.by_domain_accounts.limit(2).each do |domain|
Account.remote.by_domain_accounts.each do |acct|
domain = acct.domain
say("Starting domain block for #{domain} #{dry_run}", :green)
existing_domain_block = DomainBlock.find_by(domain: domain)
if domain.present?
existing_domain_block = DomainBlock.find_by(domain: domain)
unless existing_domain_block.present?
say("Domain block for #{domain} is starting #{dry_run}", :green)
unless options[:dry_run]
domain_block = DomainBlock.new(domain: domain, severity: :suspend)
DomainBlockWorker.perform_async(@domain_block.id)
unless existing_domain_block.present?
say("Domain block for #{domain} is starting #{dry_run}", :green)
unless options[:dry_run]
domain_block = DomainBlock.new(domain: domain, severity: :suspend)
DomainBlockWorker.perform_async(domain_block.id)
end
else
say("Domain block for #{domain} is already implemented #{dry_run}", :green)
end
else
say("Domain block for #{domain} is already implemented #{dry_run}", :green)
end
end