Skip to content

Commit ef6bc35

Browse files
committed
[RAILS] Added, that STDERR/STDOUT are flushed per batch, and the progress bar is forcibly displayed initially
1 parent 548c4c8 commit ef6bc35

File tree

1 file changed

+2
-0
lines changed
  • elasticsearch-rails/lib/elasticsearch/rails/tasks

1 file changed

+2
-0
lines changed

elasticsearch-rails/lib/elasticsearch/rails/tasks/import.rb

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
klass = eval(ENV['CLASS'].to_s)
4646
total = klass.count rescue nil
4747
pbar = ANSI::Progressbar.new(klass.to_s, total) rescue nil
48+
pbar.__send__ :show if pbar
4849

4950
unless ENV['DEBUG']
5051
begin
@@ -61,6 +62,7 @@
6162
type: ENV.fetch('TYPE', nil) do |response|
6263
pbar.inc response['items'].size if pbar
6364
STDERR.flush
65+
STDOUT.flush
6466
end
6567
pbar.finish if pbar
6668

0 commit comments

Comments
 (0)