From fa5650d399f51a596e5c126b3ce65347409d4fe9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 22 Feb 2021 08:22:56 -0300 Subject: lei q: reduce wasted IMAP connection for auth We can rework the first lei2mail worker to authenticate, and then share auth info with the rest of the lei2mail workers. As with "lei import", this uses PktOp and lei-daemon to share updated credentials between the first an subsequent l2m workers. --- lib/PublicInbox/LeiQuery.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/LeiQuery.pm') diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index 398f834f..64c9394c 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -13,14 +13,11 @@ sub prep_ext { # externals_each callback sub _start_query { my ($self) = @_; - if (my $nwr = $self->{nwr}) { + if (my $net = $self->{net}) { require PublicInbox::LeiAuth; - my $auth = $self->{auth} = PublicInbox::LeiAuth->new($nwr); - my $lxs = $self->{lxs}; - $auth->auth_start($self, $lxs->can('do_query'), $lxs, $self); - } else { - $self->{lxs}->do_query($self); + $self->{auth} = PublicInbox::LeiAuth->new($net); } + $self->{lxs}->do_query($self); } sub qstr_add { # PublicInbox::InputPipe::consume callback for --stdin -- cgit v1.2.3-24-ge0c7