diff options
author | Eric Wong <e@80x24.org> | 2021-06-09 20:27:50 -0300 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-06-10 09:21:07 +0000 |
commit | be365fb4bd3eda10294d4a916321c28b90dd723d (patch) | |
tree | 846400a31985a30d20ca07b34f302198b9cd9f9d /lib/PublicInbox/LeiTag.pm | |
parent | 59be5c57763a64c04ecbb9a344b60c435a43fb24 (diff) | |
download | public-inbox-be365fb4bd3eda10294d4a916321c28b90dd723d.tar.gz |
"unimported" is more meaningful than "missing", here. And instead of having every worker spew about unimported messages, we'll accumulate and only print one warning line. This necessitated alterating ->DESTROY behavior and persisting the client socket within the $lei object itself, not just the PktOp consumer object.
Diffstat (limited to 'lib/PublicInbox/LeiTag.pm')
-rw-r--r-- | lib/PublicInbox/LeiTag.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/PublicInbox/LeiTag.pm b/lib/PublicInbox/LeiTag.pm index e0532653..463fb921 100644 --- a/lib/PublicInbox/LeiTag.pm +++ b/lib/PublicInbox/LeiTag.pm @@ -15,7 +15,7 @@ sub input_eml_cb { # used by PublicInbox::LeiInput::input_fh $self->{lei}->{sto}->ipc_do('update_xvmd', $xoids, $eml, $self->{vmd_mod}); } else { - ++$self->{missing}; + ++$self->{unimported}; } } @@ -40,7 +40,7 @@ sub lei_tag { # the "lei tag" method my ($lei, @argv) = @_; my $sto = $lei->_lei_store(1); $sto->write_prepare($lei); - my $self = bless { missing => 0 }, __PACKAGE__; + my $self = bless {}, __PACKAGE__; $lei->ale; # refresh and prepare my $vmd_mod = $self->vmd_mod_extract(\@argv); return $lei->fail(join("\n", @{$vmd_mod->{err}})) if $vmd_mod->{err}; @@ -58,10 +58,10 @@ sub lei_tag { # the "lei tag" method $lei->wait_wq_events($op_c, $ops); } -sub note_missing { +sub note_unimported { my ($self) = @_; - my $n = $self->{missing} or return; - $self->{lei}->child_error(1 << 8, "$n missed messages"); + my $n = $self->{unimported} or return; + $self->{lei}->{pkt_op_p}->pkt_do('incr', 'unimported', $n); } sub ipc_atfork_child { @@ -69,7 +69,7 @@ sub ipc_atfork_child { PublicInbox::LeiInput::input_only_atfork_child($self); $self->{lse} = $self->{lei}->{sto}->search; # this goes out-of-scope at worker process exit: - PublicInbox::OnDestroy->new($$, \¬e_missing, $self); + PublicInbox::OnDestroy->new($$, \¬e_unimported, $self); } # Workaround bash word-splitting s to ['kw', ':', 'keyword' ...] |