From cccff5cbaf8e9800dbcb67dd497586bdb0a8521e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 25 Apr 2024 21:31:46 +0000 Subject: daemon: share and allow configuring Xapian helpers Xapian helper processes are disabled by default once again. However, they can be enabled via the new `-X INTEGER' parameter. One big positive is the Xapian helpers being spawned by the top-level daemon means they can be shared freely across all workers for improved load balancing and memory reduction. --- lib/PublicInbox/Search.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Search.pm') diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index b7732ae5..4adef366 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -11,7 +11,7 @@ our @EXPORT_OK = qw(retry_reopen int_val get_pct xap_terms); use List::Util qw(max); use POSIX qw(strftime); use Carp (); -our $XHC; +our $XHC = 0; # defined but false # values for searching, changing the numeric value breaks # compatibility with old indices (so don't change them it) @@ -57,7 +57,7 @@ use constant { }; use PublicInbox::Smsg; -use PublicInbox::Over; +eval { require PublicInbox::Over }; our $QP_FLAGS; our %X = map { $_ => 0 } qw(BoolWeight Database Enquire QueryParser Stem Query); our $Xap; # 'Xapian' or 'Search::Xapian' @@ -428,9 +428,9 @@ sub mset { do_enquire($self, $qry, $opt, TS); } -sub xhc_start_maybe () { +sub xhc_start_maybe (@) { require PublicInbox::XapClient; - my $xhc = PublicInbox::XapClient::start_helper(); + my $xhc = PublicInbox::XapClient::start_helper(@_); require PublicInbox::XhcMset if $xhc; $xhc; } -- cgit v1.2.3-24-ge0c7