about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-26 10:16:22 +0000
committerEric Wong <e@80x24.org>2020-12-27 09:30:33 +0000
commit41464d205ade16a5a847061fa2eb706a33b52a88 (patch)
tree71d6936a75dc2aa1525e4597d394a39cabf8f000 /script
parentae8df17135014a64a9f1def786f66c9c16b05fcf (diff)
downloadpublic-inbox-41464d205ade16a5a847061fa2eb706a33b52a88.tar.gz
With --watch, the output may be redirected to a pipe or socket
which Perl may decide to buffer.  Ensure Perl doesn't buffer
these outputs since they can provide real-time status updates
in response to signals or FS activity.
Diffstat (limited to 'script')
-rw-r--r--script/public-inbox-extindex4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/public-inbox-extindex b/script/public-inbox-extindex
index 607baa3e..17986f60 100644
--- a/script/public-inbox-extindex
+++ b/script/public-inbox-extindex
@@ -33,7 +33,9 @@ GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i
         or die $help;
 if ($opt->{help}) { print $help; exit 0 };
 die "--jobs must be >= 0\n" if defined $opt->{jobs} && $opt->{jobs} < 0;
-
+require IO::Handle;
+STDOUT->autoflush(1);
+STDERR->autoflush(1);
 # require lazily to speed up --help
 my $eidx_dir = shift(@ARGV) // die "E: $help";
 local $SIG{USR1} = 'IGNORE'; # to be overridden in eidx_sync