-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# handles "lei q" command and provides internals for
package PublicInbox::LeiQuery;
use strict;
use v5.10.1;
+use PublicInbox::OverIdx;
sub prep_ext { # externals_each callback
my ($lxs, $exclude, $loc) = @_;
require PublicInbox::LeiOverview;
PublicInbox::LeiOverview->new($self) or return;
my $opt = $self->{opt};
+ PublicInbox::OverIdx::fork_ok($opt);
my ($xj, $mj) = split(/,/, $opt->{jobs} // '');
(defined($xj) && $xj ne '' && $xj !~ /\A[1-9][0-9]*\z/) and
die "`$xj' search jobs must be >= 1\n";
-# Copyright (C) 2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# "lei up" - updates the result of "lei q --save"
use v5.10.1;
# n.b. we use LeiInput to setup IMAP auth
use parent qw(PublicInbox::IPC PublicInbox::LeiInput);
-use PublicInbox::LeiSavedSearch;
+use PublicInbox::LeiSavedSearch; # OverIdx
use PublicInbox::DS;
use PublicInbox::PktOp;
use PublicInbox::LeiFinmsg;
my $upq = [ (@{$self->{o_local} // []}, @{$self->{o_remote} // []}) ];
return up1($lei, $upq->[0]) if @$upq == 1; # just one, may start MUA
+ PublicInbox::OverIdx::fork_ok($lei->{opt});
# FIXME: this is also used per-query, see lei->_start_query
my $j = $lei->{opt}->{jobs} || do {
my $n = $self->detect_nproc // 1;
$smsg->{-vivify_xvmd} = \@vivify_xvmd;
}
+sub fork_ok {
+ return 1 if $DBD::SQLite::sqlite_version >= 3008003;
+ my ($opt) = @_;
+ my @j = split(/,/, $opt->{jobs} // '');
+ state $warned;
+ grep { $_ > 1 } @j and $warned //= warn('DBD::SQLite version is ',
+ $DBD::SQLite::sqlite_version,
+ ", need >= 3008003 (3.8.3) for --jobs > 1\n");
+ $opt->{jobs} = '1,1';
+ undef;
+}
+
1;