0
0
Fork 0

Remove the stub_stdout wrapper around CLI specs (#28340)

This commit is contained in:
Matt Jankowski 2023-12-13 05:14:19 -05:00 committed by GitHub
parent 3a59365e40
commit 8a3d8c6c14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 110 additions and 58 deletions

View file

@ -42,7 +42,13 @@ module Mastodon::CLI
pool = Concurrent::FixedThreadPool.new(options[:concurrency], max_queue: options[:concurrency] * 10)
importers = indices.index_with { |index| "Importer::#{index.name}Importer".constantize.new(batch_size: options[:batch_size], executor: pool) }
progress = ProgressBar.create(total: nil, format: '%t%c/%u |%b%i| %e (%r docs/s)', autofinish: false)
progress = ProgressBar.create(
{
total: nil,
format: '%t%c/%u |%b%i| %e (%r docs/s)',
autofinish: false,
}.merge(progress_output_options)
)
Chewy::Stash::Specification.reset! if options[:reset_chewy]
@ -116,5 +122,9 @@ module Mastodon::CLI
say('Cannot run with this batch_size setting, must be at least 1', :red)
exit(1)
end
def progress_output_options
Rails.env.test? ? { output: ProgressBar::Outputs::Null } : {}
end
end
end