diff options
author | Eric Wong <e@80x24.org> | 2023-07-27 21:18:55 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-07-27 23:23:08 +0000 |
commit | 003b102efec28f52e8e4dbb0191d0f404f85fb7c (patch) | |
tree | fef09c561787e5167fea73cbbc71af83a921230e /lib/PublicInbox/LeiQuery.pm | |
parent | 2f3dc31d07369957efcec8be36158e73bdbd1844 (diff) | |
download | public-inbox-003b102efec28f52e8e4dbb0191d0f404f85fb7c.tar.gz |
Due to historic reasons, LeiQuery.pm gets loaded with LEI.pm and -clone depends on LEI. So delay loading any DBI-dependent modules until querying is actually required.
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r-- | lib/PublicInbox/LeiQuery.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index 3337e5d4..26cfb3fd 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -4,9 +4,7 @@ # handles "lei q" command and provides internals for # several other sub-commands (up, lcat, ...) package PublicInbox::LeiQuery; -use strict; -use v5.10.1; -use PublicInbox::OverIdx; +use v5.12; sub prep_ext { # externals_each callback my ($lxs, $exclude, $loc) = @_; @@ -18,6 +16,7 @@ sub _start_query { # used by "lei q" and "lei up" require PublicInbox::LeiOverview; PublicInbox::LeiOverview->new($self) or return; my $opt = $self->{opt}; + require PublicInbox::OverIdx; # loads DBI PublicInbox::OverIdx::fork_ok($opt); my ($xj, $mj) = split(/,/, $opt->{jobs} // ''); (defined($xj) && $xj ne '' && $xj !~ /\A[1-9][0-9]*\z/) and |