]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiSearch.pm
www: move mirror instructions to /text/
[public-inbox.git] / lib / PublicInbox / LeiSearch.pm
index 37bfc65e27cc7515b0b7d285b84e81120dbd3d5f..47160ed98b7a81a4988cd9187fb8afd55a177217 100644 (file)
@@ -42,9 +42,9 @@ sub _oid_kw { # retry_reopen callback
 }
 
 # returns undef if blob is unknown
-sub oid_keywords {
-       my ($self, $oidhex) = @_;
-       my @num = $self->over->blob_exists($oidhex) or return;
+sub oidbin_keywords {
+       my ($self, $oidbin) = @_;
+       my @num = $self->over->oidbin_exists($oidbin) or return;
        $self->retry_reopen(\&_oid_kw, \@num);
 }
 
@@ -55,13 +55,17 @@ sub _xsmsg_vmd { # retry_reopen
        $kw{flagged} = 1 if delete($smsg->{lei_q_tt_flagged});
        my @num = $self->over->blob_exists($smsg->{blob});
        for my $num (@num) { # there should only be one...
-               $doc = $xdb->get_document(num2docid($self, $num));
-               $x = xap_terms('K', $doc);
-               %kw = (%kw, %$x);
-               if ($want_label) { # JSON/JMAP only
-                       $x = xap_terms('L', $doc);
-                       %L = (%L, %$x);
-               }
+               eval {
+                       $doc = $xdb->get_document(num2docid($self, $num));
+                       $x = xap_terms('K', $doc);
+                       %kw = (%kw, %$x);
+                       if ($want_label) { # JSON/JMAP only
+                               $x = xap_terms('L', $doc);
+                               %L = (%L, %$x);
+                       }
+               };
+               warn "$$ $0 #$num (nshard=$self->{nshard}) $smsg->{blob}: $@"
+                       if $@;
        }
        $smsg->{kw} = [ sort keys %kw ] if scalar(keys(%kw));
        $smsg->{L} = [ sort keys %L ] if scalar(keys(%L));