Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into feature/removing_ruby_junk

This commit is contained in:
mgabdev
2020-11-25 16:43:09 -06:00
11 changed files with 66 additions and 30 deletions

View File

@@ -39,6 +39,34 @@ module GabSocial
say("Removed #{custom_emojis_count} custom emojis", :green)
end
option :dry_run, type: :boolean
desc 'deleteallremote', 'Remove all remote data'
def deleteallremote
dry_run = options[:dry_run] ? ' (DRY RUN)' : ''
Account.remote.by_domain_accounts.find_in_batches do |acct|
domain = acct.domain
say("\n\n\n - Starting domain block for #{domain} #{dry_run}", :green)
if domain.present?
existing_domain_block = DomainBlock.find_by(domain: domain)
unless existing_domain_block.present?
say("\nDomain 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("\nDomain block for #{domain} is already implemented #{dry_run}", :red)
end
end
end
say('\n\n - Domain block deleteallremote done', :green)
end
option :concurrency, type: :numeric, default: 50, aliases: [:c]
option :silent, type: :boolean, default: false, aliases: [:s]
option :format, type: :string, default: 'summary', aliases: [:f]