From 0054246c2d03fcc91bc899da5ef41a68f505e542 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 2 Nov 2021 18:14:44 +0000 Subject: lei: simplify common LeiInput users with ->wq1_start This method replaces a common pattern of starting workers, preparing internal auth ops, and asynchronous waiting of command completion. It also adds missing LeiAuth support to rediff and rm which rarely need auth. --- lib/PublicInbox/LeiP2q.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/PublicInbox/LeiP2q.pm') diff --git a/lib/PublicInbox/LeiP2q.pm b/lib/PublicInbox/LeiP2q.pm index 09ec0a07..610adb78 100644 --- a/lib/PublicInbox/LeiP2q.pm +++ b/lib/PublicInbox/LeiP2q.pm @@ -183,12 +183,7 @@ sub lei_p2q { # the "lei patch-to-query" entry point $lei->{opt}->{'in-format'} //= 'eml' if $lei->{opt}->{stdin}; my $self = bless { missing_ok => 1 }, __PACKAGE__; $self->prepare_inputs($lei, \@inputs) or return; - my $ops = {}; - $lei->{auth}->op_merge($ops, $self, $lei) if $lei->{auth}; - (my $op_c, $ops) = $lei->workers_start($self, 1, $ops); - $lei->{wq1} = $self; - net_merge_all_done($self) unless $lei->{auth}; - $lei->wait_wq_events($op_c, $ops); + $lei->wq1_start($self); } sub ipc_atfork_child { -- cgit v1.2.3-24-ge0c7