lib/PublicInbox/LEI.pm | 3 ++- lib/PublicInbox/LeiExportKw.pm | 1 - lib/PublicInbox/LeiImport.pm | 1 - lib/PublicInbox/LeiLsMailSource.pm | 3 +-- lib/PublicInbox/LeiLsSearch.pm | 2 +- lib/PublicInbox/LeiRefreshMailSync.pm | 4 +--- lib/PublicInbox/LeiRm.pm | 2 +- lib/PublicInbox/LeiTag.pm | 3 +-- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 9794497b6e3e03a4612a139d7f37f335bb673b49..41e761f8aabf939e81af2afb0b82bf7058b83e5e 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -258,7 +258,7 @@ verbose|v+ incremental!), @net_opt, # mainly for --proxy= @c_opt ], 'import' => [ 'LOCATION...|--stdin', 'one-time import/update from URL or filesystem', - qw(stdin| offset=i recursive|r exclude=s include|I=s jobs=s new-only + qw(stdin| offset=i recursive|r exclude=s include|I=s new-only lock=s@ in-format|F=s kw! verbose|v+ incremental! mail-sync!), @net_opt, @c_opt ], 'forget-mail-sync' => [ 'LOCATION...', @@ -627,6 +627,7 @@ $ops->{''} //= [ $wq->can('_lei_wq_eof') || \&wq_eof, $lei ]; my $end = $lei->pkt_op_pair; my $ident = $wq->{-wq_ident} // "lei-$lei->{cmd} worker"; $flds->{lei} = $lei; + $wq->{-wq_nr_workers} //= $jobs; # lock, no incrementing $wq->wq_workers_start($ident, $jobs, $lei->oldset, $flds); delete $lei->{pkt_op_p}; my $op_c = delete $lei->{pkt_op_c}; diff --git a/lib/PublicInbox/LeiExportKw.pm b/lib/PublicInbox/LeiExportKw.pm index d37f3768202619d434060981580ae27b0d2a76e0..8b8aa373a37199c1705835f8deb254c7e43f0f5b 100644 --- a/lib/PublicInbox/LeiExportKw.pm +++ b/lib/PublicInbox/LeiExportKw.pm @@ -124,7 +124,6 @@ undef $lms; # for fork my $ops = {}; $sto->write_prepare($lei); $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; - $self->{-wq_nr_workers} = $j // 1; # locked (my $op_c, $ops) = $lei->workers_start($self, $j, $ops); $lei->{wq1} = $self; $lei->{-err_type} = 'non-fatal'; diff --git a/lib/PublicInbox/LeiImport.pm b/lib/PublicInbox/LeiImport.pm index 7c563bd8c8e79e864325cd0833e88d59406a120e..b1cb3940ee365cfe7f65e26585b53658cb576ea8 100644 --- a/lib/PublicInbox/LeiImport.pm +++ b/lib/PublicInbox/LeiImport.pm @@ -101,7 +101,6 @@ $lei->err('# --new-only is only for IMAP'); } my $ops = {}; $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; - $self->{-wq_nr_workers} = $j // 1; # locked $lei->{-eml_noisy} = 1; (my $op_c, $ops) = $lei->workers_start($self, $j, $ops); $lei->{wq1} = $self; diff --git a/lib/PublicInbox/LeiLsMailSource.pm b/lib/PublicInbox/LeiLsMailSource.pm index f012e10e89c2d10a71da50414be285ebe4a65d0f..bcb1838e9e689401fefb8913cb2ccbd80d8dc06e 100644 --- a/lib/PublicInbox/LeiLsMailSource.pm +++ b/lib/PublicInbox/LeiLsMailSource.pm @@ -96,8 +96,7 @@ $self->prepare_inputs($lei, [ $url ]) or return; $lei->start_pager if -t $lei->{1}; my $ops = {}; $lei->{auth}->op_merge($ops, $self); - my $j = $self->{-wq_nr_workers} = 1; # locked - (my $op_c, $ops) = $lei->workers_start($self, $j, $ops); + (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}; diff --git a/lib/PublicInbox/LeiLsSearch.pm b/lib/PublicInbox/LeiLsSearch.pm index 7013613523e33acfcfcfadc305bf136302756e68..aebf018429d3949ca9e2de8704d8ce680604e7f0 100644 --- a/lib/PublicInbox/LeiLsSearch.pm +++ b/lib/PublicInbox/LeiLsSearch.pm @@ -71,7 +71,7 @@ } sub bg_worker ($$$) { my ($lei, $pfx, $json) = @_; - my $self = bless { -wq_nr_workers => 1, json => $json }, __PACKAGE__; + my $self = bless { json => $json }, __PACKAGE__; my ($op_c, $ops) = $lei->workers_start($self, 1); $lei->{wq1} = $self; $self->wq_io_do('do_ls_search_long', [], $pfx); diff --git a/lib/PublicInbox/LeiRefreshMailSync.pm b/lib/PublicInbox/LeiRefreshMailSync.pm index 09a7ead06a0a43c1078b93816a826aa5a3019516..cdd997253a609dc5871bdb7e9b17c88aa1468bce 100644 --- a/lib/PublicInbox/LeiRefreshMailSync.pm +++ b/lib/PublicInbox/LeiRefreshMailSync.pm @@ -84,11 +84,9 @@ $sto->write_prepare($lei); my $self = bless { missing_ok => 1 }, __PACKAGE__; $lei->{opt}->{'mail-sync'} = 1; # for prepare_inputs $self->prepare_inputs($lei, \@folders) or return; - my $j = $lei->{opt}->{jobs} || scalar(@{$self->{inputs}}) || 1; my $ops = {}; $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; - $self->{-wq_nr_workers} = $j // 1; # locked - (my $op_c, $ops) = $lei->workers_start($self, $j, $ops); + (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}; diff --git a/lib/PublicInbox/LeiRm.pm b/lib/PublicInbox/LeiRm.pm index 778fa1de92763a14e49ff2e917048ecc86bb2a37..3371f3ed00e469f66233567ff50c782532514a92 100644 --- a/lib/PublicInbox/LeiRm.pm +++ b/lib/PublicInbox/LeiRm.pm @@ -32,7 +32,7 @@ sub lei_rm { my ($lei, @inputs) = @_; $lei->_lei_store(1)->write_prepare($lei); $lei->{opt}->{'in-format'} //= 'eml'; - my $self = bless { -wq_nr_workers => 1 }, __PACKAGE__; + my $self = bless {}, __PACKAGE__; $self->prepare_inputs($lei, \@inputs) or return; my ($op_c, $ops) = $lei->workers_start($self, 1); $lei->{wq1} = $self; diff --git a/lib/PublicInbox/LeiTag.pm b/lib/PublicInbox/LeiTag.pm index 44d77b881c04136c1f190e3e166298e100fd101c..c4f5ecffb575168044b216139874e2d8a14c5e2d 100644 --- a/lib/PublicInbox/LeiTag.pm +++ b/lib/PublicInbox/LeiTag.pm @@ -50,8 +50,7 @@ grep(defined, @$vmd_mod{qw(+kw +L -L -kw)}) or return $lei->fail('no keywords or labels specified'); my $ops = {}; $lei->{auth}->op_merge($ops, $self) if $lei->{auth}; - my $j = $self->{-wq_nr_workers} = 1; # locked for now - (my $op_c, $ops) = $lei->workers_start($self, $j, $ops); + (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};