about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiQuery.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-19 09:33:38 +0000
committerEric Wong <e@80x24.org>2021-10-19 17:29:16 +0000
commit95ae3c4a45435a8208a8f10b27c78329b5ad3e85 (patch)
treea5054d61dd913f4d56845248835b1898d5e5d183 /lib/PublicInbox/LeiQuery.pm
parent8e91ad5eb95dff4070fa32242a59f373df8d9ff5 (diff)
downloadpublic-inbox-95ae3c4a45435a8208a8f10b27c78329b5ad3e85.tar.gz
This allows "lei up" to continue processing unrelated externals
if on output fails.
Diffstat (limited to 'lib/PublicInbox/LeiQuery.pm')
-rw-r--r--lib/PublicInbox/LeiQuery.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index ec2ece05..56b82acc 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -18,17 +18,15 @@ sub _start_query { # used by "lei q" and "lei up"
         PublicInbox::LeiOverview->new($self) or return;
         my $opt = $self->{opt};
         my ($xj, $mj) = split(/,/, $opt->{jobs} // '');
-        if (defined($xj) && $xj ne '' && $xj !~ /\A[1-9][0-9]*\z/) {
-                return $self->fail("`$xj' search jobs must be >= 1");
-        }
+        (defined($xj) && $xj ne '' && $xj !~ /\A[1-9][0-9]*\z/) and
+                die "`$xj' search jobs must be >= 1\n";
         my $lxs = $self->{lxs};
         $xj ||= $lxs->concurrency($opt); # allow: "--jobs ,$WRITER_ONLY"
         my $nproc = $lxs->detect_nproc || 1; # don't memoize, schedtool(1) exists
         $xj = $nproc if $xj > $nproc;
         $lxs->{-wq_nr_workers} = $xj;
-        if (defined($mj) && $mj !~ /\A[1-9][0-9]*\z/) {
-                return $self->fail("`$mj' writer jobs must be >= 1");
-        }
+        (defined($mj) && $mj !~ /\A[1-9][0-9]*\z/) and
+                die "`$mj' writer jobs must be >= 1\n";
         my $l2m = $self->{l2m};
         # we use \1 (a ref) to distinguish between default vs. user-supplied
         if ($l2m && grep { $opt->{$_} //= \1 } (qw(mail-sync import-remote
@@ -112,7 +110,7 @@ sub lxs_prepare {
                 }
         }
         ($lxs->locals || $lxs->remotes) ? ($self->{lxs} = $lxs) :
-                $self->fail('no local or remote inboxes to search');
+                die("no local or remote inboxes to search\n");
 }
 
 # the main "lei q SEARCH_TERMS" method