From bf8df8160076d7a1231e0858ca4c243df3b7c860 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 3 Jan 2021 02:06:12 +0000 Subject: searchidxshard: use PublicInbox::IPC to kill lots of code 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. --- lib/PublicInbox/SearchIdx.pm | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') 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 { -- cgit v1.2.3-24-ge0c7