about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-03 02:06:12 +0000
committerEric Wong <e@80x24.org>2021-01-03 18:30:29 +0000
commitbf8df8160076d7a1231e0858ca4c243df3b7c860 (patch)
treeba3de09e8fbe004b167feeab108ce92dfdc51a51 /lib/PublicInbox/SearchIdx.pm
parent5fd4a152ee0d43227582783a0641dda4e56efe91 (diff)
downloadpublic-inbox-bf8df8160076d7a1231e0858ca4c243df3b7c860.tar.gz
It's nice to prove the new code works by swapping it into
the current V2Writable / SearchIdxShard packages.  This is
only the first step for the core bits, and we'll be able
to delete more code in a subsequent patch.
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 {