From d893d3c028a7fc442e024e5e5b8ea737945b19b3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 31 Dec 2020 17:47:50 -1200 Subject: treewide: reduce load_xapian* callsites Hopefully this will make it easier to spot dependency bugs in the future. --- lib/PublicInbox/LEI.pm | 1 - lib/PublicInbox/LeiStore.pm | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 320a2bfc..2bc4a916 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -453,7 +453,6 @@ sub _lei_store ($;$) { my $cfg = _lei_cfg($self, $creat); $cfg->{-lei_store} //= do { require PublicInbox::LeiStore; - PublicInbox::SearchIdx::load_xapian_writable(); my $dir = $cfg->{'leistore.dir'}; $dir //= _store_path($self->{env}) if $creat; return unless $dir; diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 7c62ffea..a3decf5f 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -24,10 +24,7 @@ sub new { my (undef, $dir, $opt) = @_; my $eidx = PublicInbox::ExtSearchIdx->new($dir, $opt); my $self = bless { priv_eidx => $eidx }, __PACKAGE__; - if ($opt->{creat}) { - PublicInbox::SearchIdx::load_xapian_writable(); - eidx_init($self); - } + eidx_init($self) if $opt->{creat}; $self; } -- cgit v1.2.3-24-ge0c7