]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei up: only delay non-zero "# $NR written to ..."
authorEric Wong <e@80x24.org>
Fri, 10 Sep 2021 11:46:53 +0000 (11:46 +0000)
committerEric Wong <e@80x24.org>
Fri, 10 Sep 2021 20:43:33 +0000 (20:43 +0000)
"# 0 written to $FOLDER" messages aren't important to the
user, so we can show them in real time and allow them to
be lost in the terminal scroll.  When >0 messages are
written to a folder, we'll show them last so a user
will know which folders to open with their MUA.

lib/PublicInbox/LeiXSearch.pm

index b6d7bf2b9521573281a23fea68a4c6c42a573a5a..709a3b3ab7ed4efe2177a922fe32e9576d51ba99 100644 (file)
@@ -400,8 +400,9 @@ Error closing $lei->{ovv}->{dst}: $!
                my $tot = $lei->{-mset_total} // 0;
                my $nr = $lei->{-nr_write} // 0;
                if ($l2m) {
-                       $lei->qfin("# $nr written to " .
-                               "$lei->{ovv}->{dst} ($tot matches)");
+                       my $m = "# $nr written to " .
+                               "$lei->{ovv}->{dst} ($tot matches)";
+                       $nr ? $lei->qfin($m) : $lei->qerr($m);
                } else {
                        $lei->qerr("# $tot matches");
                }