Remove the stub_stdout
wrapper around CLI specs (#28340)
This commit is contained in:
parent
3a59365e40
commit
8a3d8c6c14
5 changed files with 110 additions and 58 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue