]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiQuery.pm
lei q: limit concurrency to 4 remote connections
[public-inbox.git] / lib / PublicInbox / LeiQuery.pm
index acab3c2c65ca98801aa3cfccb47d66107da6c19b..a7938e8b1406c488c62d56a40b1470c35155bab3 100644 (file)
@@ -26,7 +26,7 @@ sub lei_q {
                my $cb = $lxs->can('prepare_external');
                $self->_externals_each($cb, $lxs);
        }
-       my $xj = $opt->{thread} ? $lxs->locals : ($lxs->remotes + 1);
+       my $xj = $lxs->concurrency($opt);
        my $ovv = PublicInbox::LeiOverview->new($self) or return;
        $self->atfork_prepare_wq($lxs);
        $lxs->wq_workers_start('lei_xsearch', $xj, $self->oldset);