]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ExtSearchIdx.pm
searchidx: all indexers check for bad blobs
[public-inbox.git] / lib / PublicInbox / ExtSearchIdx.pm
index 11f7786def257155329ab9f113136b9868f4dd1f..b0a12bcabce0e97e04f6e8fb13de346f91439f90 100644 (file)
@@ -19,7 +19,8 @@ use v5.10.1;
 use parent qw(PublicInbox::ExtSearch PublicInbox::Lock);
 use Carp qw(croak carp);
 use PublicInbox::Search;
-use PublicInbox::SearchIdx qw(crlf_adjust prepare_stack is_ancestor);
+use PublicInbox::SearchIdx qw(crlf_adjust prepare_stack is_ancestor
+       is_bad_blob);
 use PublicInbox::OverIdx;
 use PublicInbox::MiscIdx;
 use PublicInbox::MID qw(mids);
@@ -91,16 +92,6 @@ sub attach_config {
        $cfg->each_inbox(\&_ibx_attach, $self);
 }
 
-sub is_bad_blob ($$$$) {
-       my ($oid, $type, $size, $expect_oid) = @_;
-       if ($type ne 'blob') {
-               carp "W: $expect_oid is not a blob (type=$type)";
-               return 1;
-       }
-       croak "BUG: $oid != $expect_oid" if $oid ne $expect_oid;
-       $size == 0 ? 1 : 0; # size == 0 means purged
-}
-
 sub check_batch_limit ($) {
        my ($req) = @_;
        my $self = $req->{self};