about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-30 20:55:13 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-30 21:05:49 +0000
commit0321a1a9e7ae9c9d878d547ee67659ef8aa95689 (patch)
tree1fd6191520c5252025190da1970c35cf8b16262f
parentc4aa293b2320feb805c5afeaa373f608e5bc8618 (diff)
downloadpublic-inbox-0321a1a9e7ae9c9d878d547ee67659ef8aa95689.tar.gz
We will vivify multiple ghosts if a message has multiple
Message-IDs.
-rw-r--r--lib/PublicInbox/SearchIdx.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 9638e0c5..36f97b36 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -539,9 +539,9 @@ sub link_and_save {
         $doc->add_boolean_term('XPATH' . $xpath) if defined $xpath;
         $doc->add_boolean_term('Q' . $_) foreach @$mids;
 
-        my $vivified = 0;
         $self->{skel} and die "Should not have read-only skel here\n";;
         foreach my $mid (@$mids) {
+                my $vivified = 0;
                 $self->each_smsg_by_mid($mid, sub {
                         my ($cur) = @_;
                         my $type = $cur->type;
@@ -563,10 +563,8 @@ sub link_and_save {
                         ++$vivified;
                         1;
                 });
-        }
-        if ($vivified > 1) {
-                my $id = '<'.join('> <', @$mids).'>';
-                warn "BUG: vivified multiple ($vivified) ghosts for $id\n";
+                $vivified > 1 and warn
+                        "BUG: vivified multiple ($vivified) ghosts for $mid\n";
         }
         # not really important, but we return any vivified ghost docid, here:
         return $doc_id if defined $doc_id;