about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 88349faa..d83fd4ca 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -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 {