]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiXSearch.pm
lei up: improve --all=local stderr output
[public-inbox.git] / lib / PublicInbox / LeiXSearch.pm
index 971f3a06a7fd49442582e509b6709c957bf18e7d..b9f0d6924d4ca5c9617435e3d5081cc9c65db16e 100644 (file)
@@ -274,8 +274,7 @@ sub each_remote_eml { # callback for MboxReader->mboxrd
                        $smsg->{kw} = []; # short-circuit xsmsg_vmd
                }
        }
-       $smsg->{blob} //= $xoids ? (keys(%$xoids))[0]
-                               : git_sha(1, $eml)->hexdigest;
+       $smsg->{blob} //= $xoids ? (keys(%$xoids))[0] : $lei->git_blob_id($eml);
        _smsg_fill($smsg, $eml);
        wait_startq($lei);
        if ($lei->{-progress}) {
@@ -375,8 +374,8 @@ sub query_done { # EOF callback for main daemon
        if ($lei->{opt}->{'mail-sync'} && !$lei->{sto}) {
                warn "BUG: {sto} missing with --mail-sync";
        }
-       my $wait = $lei->{sto} ? $lei->{sto}->ipc_do('done') : undef;
-       $wait = $lei->{v2w} ? $lei->{v2w}->ipc_do('done') : undef;
+       $lei->sto_done_request if $lei->{sto};
+       my $wait = $lei->{v2w} ? $lei->{v2w}->ipc_do('done') : undef;
        $lei->{ovv}->ovv_end($lei);
        my $start_mua;
        if ($l2m) { # close() calls LeiToMail reap_compress
@@ -399,9 +398,12 @@ Error closing $lei->{ovv}->{dst}: $!
        if ($lei->{-progress}) {
                my $tot = $lei->{-mset_total} // 0;
                my $nr = $lei->{-nr_write} // 0;
-               $lei->qerr($l2m ?
-                       "# $nr written to $lei->{ovv}->{dst} ($tot matches)" :
-                       "# $tot matches");
+               if ($l2m) {
+                       $lei->qfin("# $nr written to " .
+                               "$lei->{ovv}->{dst} ($tot matches)");
+               } else {
+                       $lei->qerr("# $tot matches");
+               }
        }
        $lei->start_mua if $start_mua;
        $lei->dclose;