diff options
author | Eric Wong <e@80x24.org> | 2021-11-02 18:14:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-11-02 19:06:51 +0000 |
commit | 0054246c2d03fcc91bc899da5ef41a68f505e542 (patch) | |
tree | baef8664897ebca298398be291a0f45eff8e3c61 /lib/PublicInbox/LeiRefreshMailSync.pm | |
parent | 85d75a409a15a3b114299838e30ad608c799c7e5 (diff) | |
download | public-inbox-0054246c2d03fcc91bc899da5ef41a68f505e542.tar.gz |
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.
Diffstat (limited to 'lib/PublicInbox/LeiRefreshMailSync.pm')
-rw-r--r-- | lib/PublicInbox/LeiRefreshMailSync.pm | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/PublicInbox/LeiRefreshMailSync.pm b/lib/PublicInbox/LeiRefreshMailSync.pm index f516f572..7821008f 100644 --- a/lib/PublicInbox/LeiRefreshMailSync.pm +++ b/lib/PublicInbox/LeiRefreshMailSync.pm @@ -81,13 +81,8 @@ EOM my $self = bless { missing_ok => 1, lms => $lms }, __PACKAGE__; $lei->{opt}->{'mail-sync'} = 1; # for prepare_inputs $self->prepare_inputs($lei, \@folders) 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; $lei->{-err_type} = 'non-fatal'; - net_merge_all_done($self) unless $lei->{auth}; - $lei->wait_wq_events($op_c, $ops); # net_merge_all_done if !{auth} + $lei->wq1_start($self); } sub ipc_atfork_child { # needed for PublicInbox::LeiPmdir |