]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SearchIdx.pm
searchidxshard: use PublicInbox::IPC to kill lots of code
[public-inbox.git] / lib / PublicInbox / SearchIdx.pm
index 88349faa38b7a9325a11900155d4715c9faa90de..d83fd4ca6b5abdf5d651a1b708f208990ea0b1a9 100644 (file)
@@ -414,6 +414,7 @@ sub _msgmap_init ($) {
 sub add_message {
        # mime = PublicInbox::Eml or Email::MIME object
        my ($self, $mime, $smsg, $sync) = @_;
+       begin_txn_lazy($self);
        my $mids = mids_for_index($mime);
        $smsg //= bless { blob => '' }, 'PublicInbox::Smsg'; # test-only compat
        $smsg->{mid} //= $mids->[0]; # v1 compatibility
@@ -1002,14 +1003,6 @@ sub commit_txn_lazy {
                $self->with_umask(\&_commit_txn, $self);
 }
 
-sub worker_done {
-       my ($self) = @_;
-       if (need_xapian($self)) {
-               die "$$ $0 xdb not released\n" if $self->{xdb};
-       }
-       die "$$ $0 still in transaction\n" if $self->{txn};
-}
-
 sub eidx_shard_new {
        my ($class, $eidx, $shard) = @_;
        my $self = bless {