diff options
author | Eric Wong <e@80x24.org> | 2021-04-01 17:10:40 +0500 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-01 18:25:15 +0000 |
commit | 4a132f960e04201bcf4dcc06eb34d9c47ec13457 (patch) | |
tree | 84a0828e5eacad6b1c7c9fae6d0428c9e90f71c0 /lib | |
parent | 1730d031a00654a64d1854480d0e83b62c2bfecd (diff) | |
download | public-inbox-4a132f960e04201bcf4dcc06eb34d9c47ec13457.tar.gz |
There's no point in adding vmd information for an external message if it was never stored and there's no vmd at all. We also don't need to check _docids_for for similar messages, either, since we always check lse->kw_changed, first.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/LeiStore.pm | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 48ab1d76..f2aa45bd 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -307,19 +307,11 @@ sub set_xvmd { } return unless scalar(keys(%$xoids)); - # see if it was indexed, but with different OID(s) - if (my @docids = _docids_for($self, $eml)) { - for my $docid (@docids) { - next if $seen{$docid}; - for my $oid (keys %$xoids) { - $oidx->add_xref3($docid, -1, $oid, '.'); - } - my $idx = $eidx->idx_shard($docid); - $idx->ipc_do('set_vmd', $docid, $vmd); - } - return; - } - # totally unseen + # n.b. we don't do _docids_for here, we expect the caller + # already checked $lse->kw_changed before calling this sub + + return unless (@{$vmd->{kw} // []}) || (@{$vmd->{L} // []}); + # totally unseen: my ($smsg, $idx) = _external_only($self, $xoids, $eml); $idx->ipc_do('add_vmd', $smsg->{num}, $vmd); } |