]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchidx: ignore exceptions from ->remove_term
authorEric Wong <e@80x24.org>
Tue, 27 Oct 2020 07:54:50 +0000 (07:54 +0000)
committerEric Wong <e@80x24.org>
Sat, 7 Nov 2020 10:22:10 +0000 (10:22 +0000)
This seems necessary for some cross-posted messages (and we did
it historically before we used over.sqlite3).

lib/PublicInbox/SearchIdx.pm

index 569efbb0debcdf1b7c9939b6838eda1d8819e017..06d1a9f580dfe35b436d39ae8327e211f9f110c1 100644 (file)
@@ -468,11 +468,13 @@ sub remove_eidx_info {
        my ($self, $docid, $oid, $eidx_key, $eml) = @_;
        begin_txn_lazy($self);
        my $doc = _get_doc($self, $docid, $oid) or return;
-       $doc->remove_term('O'.$eidx_key);
+       eval { $doc->remove_term('O'.$eidx_key) };
+       warn "W: ->remove_term O$eidx_key: $@\n" if $@;
        for my $l ($eml->header_raw('List-Id')) {
                $l =~ /<([^>]+)>/ or next;
                my $lid = lc $1;
-               $doc->remove_term('G' . $lid);
+               eval { $doc->remove_term('G' . $lid) };
+               warn "W: ->remove_term G$lid: $@\n" if $@;
 
                # nb: we don't remove the XL probabilistic terms
                # since terms may overlap if cross-posted.