]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiTag.pm
lei tag: fix tagging of IMAP inputs
[public-inbox.git] / lib / PublicInbox / LeiTag.pm
index 8b012b160eaf5778ffff42115b3e445ebeef60aa..06313139775446ca592ffbeeab380f16b57650b6 100644 (file)
@@ -73,8 +73,6 @@ sub tag_done_wait { # dwaitpid callback
        my ($arg, $pid) = @_;
        my ($tag, $lei) = @$arg;
        $lei->child_error($?, 'non-fatal errors during tag') if $?;
-       my $sto = delete $lei->{sto};
-       my $wait = $sto->ipc_do('done') if $sto; # PublicInbox::LeiStore::done
        $lei->dclose;
 }
 
@@ -86,9 +84,7 @@ sub tag_done { # EOF callback for main daemon
 
 sub net_merge_complete { # callback used by LeiAuth
        my ($self) = @_;
-       for my $input (@{$self->{inputs}}) {
-               $self->wq_io_do('input_path_url', [], $input);
-       }
+       $self->wq_io_do('process_inputs');
        $self->wq_close(1);
 }
 
@@ -116,7 +112,8 @@ sub lei_tag { # the "lei tag" method
        my $ops = { '' => [ \&tag_done, $lei ] };
        $lei->{auth}->op_merge($ops, $self) if $lei->{auth};
        $self->{vmd_mod} = $vmd_mod;
-       (my $op_c, $ops) = $lei->workers_start($self, 'lei_tag', 1, $ops);
+       my $j = $self->{-wq_nr_workers} = 1; # locked for now
+       (my $op_c, $ops) = $lei->workers_start($self, 'lei_tag', $j, $ops);
        $lei->{tag} = $self;
        net_merge_complete($self) unless $lei->{auth};
        $op_c->op_wait_event($ops);
@@ -179,4 +176,7 @@ sub _complete_tag {
        } grep(/$re\Q$cur/, @all);
 }
 
+no warnings 'once'; # the following works even when LeiAuth is lazy-loaded
+*net_merge_all = \&PublicInbox::LeiAuth::net_merge_all;
+
 1;