]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: do not blindly commit to lei/store on close
authorEric Wong <e@80x24.org>
Fri, 26 Mar 2021 09:51:24 +0000 (09:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 26 Mar 2021 21:51:30 +0000 (21:51 +0000)
It may hide errors/bugs, instead do it explicitly for each
worker that writes to it.  For lei_xsearch, it will be better
to close before spawning the MUA for future use since we may
need it again once the user starts changing keywords.

lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiXSearch.pm

index 6a5c32b3a4fb9b22c3ab82dcac05c49b56754595..5971563399641b20f9ee4af43db3d611ec5f7730 100644 (file)
@@ -1030,9 +1030,6 @@ sub dclose {
                }
        }
        close(delete $self->{1}) if $self->{1}; # may reap_compress
-       if (my $sto = delete $self->{sto}) {
-               $sto->ipc_do('done');
-       }
        $self->close if $self->{-event_init_done}; # PublicInbox::DS::close
 }
 
index 6410e0ea4e910b79502df2e1ce839f6831f2b400..b41daffebbdfacf3114426a0a6743dd0c0c44b1d 100644 (file)
@@ -319,6 +319,7 @@ sub query_done { # EOF callback for main daemon
        if (my $lxs = delete $lei->{lxs}) {
                $lxs->wq_wait_old(\&xsearch_done_wait, $lei);
        }
+       my $wait = $lei->{sto} ? $lei->{sto}->ipc_do('done') : undef;
        $lei->{ovv}->ovv_end($lei);
        if ($l2m) { # close() calls LeiToMail reap_compress
                if (my $out = delete $lei->{old_1}) {