]> Sergey Matveev's repositories - public-inbox.git/commitdiff
shard_add_eidx_info: pass $eidx_key instead of $ibx object
authorEric Wong <e@80x24.org>
Mon, 7 Dec 2020 07:40:53 +0000 (07:40 +0000)
committerEric Wong <e@80x24.org>
Tue, 8 Dec 2020 07:19:32 +0000 (07:19 +0000)
This improves consistency with sibling methods such as
->shard_remove_eidx_info and ->add_xref3.  Passing the
$eidx_key scalar is preferable to the entire $ibx object
for IPC-friendliness.

lib/PublicInbox/ExtSearchIdx.pm
lib/PublicInbox/SearchIdxShard.pm

index c06b25a929bff8c35834fb9b5571033f4bcf6ab1..c82d163349a755094193fb5916c617aae76fa0e1 100644 (file)
@@ -125,7 +125,7 @@ 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, $xibx, $eml);
+               $idx->shard_add_eidx_info($docid, $eidx_key, $eml);
                check_batch_limit($req);
        } else { # 'd'
                my $rm_eidx_info;
index 182bbde2519489658e0650cf1592d60d7b70ccb1..579ed1965962c5993c1488a9442a3a027e8f3da3 100644 (file)
@@ -144,8 +144,7 @@ sub index_raw {
 }
 
 sub shard_add_eidx_info {
-       my ($self, $docid, $xibx, $eml) = @_;
-       my $eidx_key = $xibx->eidx_key;
+       my ($self, $docid, $eidx_key, $eml) = @_;
        if (my $w = $self->{w}) {
                my $hdr = $eml->header_obj->as_string;
                my $len = length($hdr);