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/LeiImport.pm | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/PublicInbox/LeiImport.pm') diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index d8f39fdf..bbc0634e 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -102,14 +102,9 @@ sub do_import_index ($$@) { } ($lei->{opt}->{'new-only'} && (!$net || !$net->{imap_order})) and warn "# --new-only is only for IMAP\n"; - my $ops = {}; - $lei->{auth}->op_merge($ops, $self, $lei) if $lei->{auth}; $lei->{-eml_noisy} = 1; - (my $op_c, $ops) = $lei->workers_start($self, $j, $ops); - $lei->{wq1} = $self; $lei->{-err_type} = 'non-fatal'; - net_merge_all_done($self) unless $lei->{auth}; - $lei->wait_wq_events($op_c, $ops); + $lei->wq1_start($self, $j); } sub lei_import { # the main "lei import" method -- cgit v1.2.3-24-ge0c7