]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
extindex: {boost_in_use} field to $self
authorEric Wong <e@80x24.org>
Fri, 10 Jan 2025 23:18:16 +0000 (23:18 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 Jan 2025 04:45:31 +0000 (04:45 +0000)
There's no need to repeatedly propagate this field to every
cat-file blob request since this field is tied to the attached
config and inboxes associated with an inbox.

lib/PublicInbox/ExtSearchIdx.pm

index e63d917f1490660dff73a48985b58e1e9a56260c..242f4319c1b1e6603b7e8bb8caf72f3f2590df90 100644 (file)
@@ -230,7 +230,7 @@ sub do_xpost ($$) {
                $self->{oidx}->add_xref3($docid, $xnum, $oid, $eidx_key);
                my $idx = $self->idx_shard($docid);
                $idx->ipc_do('add_eidx_info', $docid, $eidx_key, $eml);
-               apply_boost($req, $smsg) if $req->{boost_in_use};
+               apply_boost($req, $smsg) if $self->{boost_in_use};
        } else { # 'd' no {xnum}
                $self->git->async_wait_all;
                $oid = pack('H*', $oid);
@@ -1138,7 +1138,7 @@ sub eidx_sync { # main entry point
 
        if (scalar(grep { defined($_->{boost}) } @{$self->{ibx_known}})) {
                $sync->{id2pos} //= prep_id2pos($self);
-               $sync->{boost_in_use} = 1;
+               $self->{boost_in_use} = 1;
        }
 
        if (my $msgids = delete($opt->{dedupe})) {
@@ -1329,6 +1329,7 @@ sub eidx_reload { # -extindex --watch SIGHUP handler
                delete $self->{-resync_queue};
                delete $self->{-ibx_ary_known};
                delete $self->{-ibx_ary_active};
+               delete $self->{boost_in_use};
                $self->{ibx_known} = [];
                $self->{ibx_active} = [];
                %{$self->{ibx_map}} = ();