]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ExtSearchIdx.pm
rename {pi_config} fields to {pi_cfg}
[public-inbox.git] / lib / PublicInbox / ExtSearchIdx.pm
index 4de47b5824af7a95b4ff84f5d6c97ce0df63e53b..c82d163349a755094193fb5916c617aae76fa0e1 100644 (file)
@@ -91,14 +91,6 @@ sub attach_config {
        $cfg->each_inbox(\&_ibx_attach, $self);
 }
 
-sub git_blob_digest ($) {
-       my ($bref) = @_;
-       my $dig = Digest::SHA->new(1); # XXX SHA256 later
-       $dig->add('blob '.length($$bref)."\0");
-       $dig->add($$bref);
-       $dig;
-}
-
 sub is_bad_blob ($$$$) {
        my ($oid, $type, $size, $expect_oid) = @_;
        if ($type ne 'blob') {
@@ -133,17 +125,16 @@ sub do_xpost ($$) {
        if (my $new_smsg = $req->{new_smsg}) { # 'm' on cross-posted message
                my $xnum = $req->{xnum};
                $self->{oidx}->add_xref3($docid, $xnum, $oid, $eidx_key);
-               $idx->shard_add_eidx_info($docid, $oid, $xibx, $eml);
+               $idx->shard_add_eidx_info($docid, $eidx_key, $eml);
                check_batch_limit($req);
        } else { # 'd'
                my $rm_eidx_info;
                my $nr = $self->{oidx}->remove_xref3($docid, $oid, $eidx_key,
                                                        \$rm_eidx_info);
                if ($nr == 0) {
-                       $idx->shard_remove($oid, $docid);
+                       $idx->shard_remove($docid);
                } elsif ($rm_eidx_info) {
-                       $idx->shard_remove_eidx_info($docid, $oid, $eidx_key,
-                                                       $eml);
+                       $idx->shard_remove_eidx_info($docid, $eidx_key, $eml);
                }
        }
 }
@@ -245,10 +236,6 @@ sub cur_ibx_xnum ($$) {
        my ($req, $bref) = @_;
        my $ibx = $req->{ibx} or die 'BUG: current {ibx} missing';
 
-       # XXX overkill?
-       git_blob_digest($bref)->hexdigest eq $req->{oid} or die
-               "BUG: blob mismatch $req->{oid}";
-
        $req->{eml} = PublicInbox::Eml->new($bref);
        $req->{chash} = content_hash($req->{eml});
        $req->{mids} = mids($req->{eml});
@@ -345,13 +332,11 @@ DELETE FROM xref3 WHERE docid = ? AND ibx_id = ?
        if (@$remain) {
                for my $oid (@oid) {
                        warn "I: unref #$docid $eidx_key $oid\n";
-                       $idx->shard_remove_eidx_info($docid, $oid, $eidx_key);
+                       $idx->shard_remove_eidx_info($docid, $eidx_key);
                }
        } else {
-               for my $oid (@oid) {
-                       warn "I: remove #$docid $eidx_key $oid\n";
-                       $idx->shard_remove($oid, $docid);
-               }
+               warn "I: remove #$docid $eidx_key @oid\n";
+               $idx->shard_remove($docid);
        }
 }