diff options
author | Eric Wong <e@80x24.org> | 2023-10-04 03:49:20 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-04 17:46:36 +0000 |
commit | 39afcefde3e9cec0120776a89977da88eb217d90 (patch) | |
tree | 7dd5a76a04d6245a039800199f327be4b1992a44 /lib/PublicInbox/LeiConvert.pm | |
parent | 2bac2c5e41de98f9aa50fbf69060a3bdef54f61f (diff) | |
download | public-inbox-39afcefde3e9cec0120776a89977da88eb217d90.tar.gz |
We already have an ->incr callback we can enhance to support multiple counters with a single request. Furthermore, we can just flatten the object graph by storing counters directly in the $lei object itself to reduce hash lookups.
Diffstat (limited to 'lib/PublicInbox/LeiConvert.pm')
-rw-r--r-- | lib/PublicInbox/LeiConvert.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiConvert.pm b/lib/PublicInbox/LeiConvert.pm index 1acd4558..22aba81a 100644 --- a/lib/PublicInbox/LeiConvert.pm +++ b/lib/PublicInbox/LeiConvert.pm @@ -34,9 +34,10 @@ sub process_inputs { # via wq_do $self->SUPER::process_inputs; my $lei = $self->{lei}; delete $lei->{1}; + my $l2m = delete $self->{l2m}; delete $self->{wcb}; # commit - my $nr_w = delete($lei->{-nr_write}) // 0; - my $d = (delete($lei->{-nr_seen}) // 0) - $nr_w; + my $nr_w = delete($l2m->{-nr_write}) // 0; + my $d = (delete($l2m->{-nr_seen}) // 0) - $nr_w; $d = $d ? " ($d duplicates)" : ''; $lei->qerr("# converted $nr_w messages$d"); } @@ -64,7 +65,7 @@ sub ipc_atfork_child { my ($self) = @_; my $lei = $self->{lei}; $lei->_lei_atfork_child; - my $l2m = delete $lei->{l2m}; + my $l2m = $lei->{l2m}; if (my $net = $lei->{net}) { # may prompt user once $net->{mics_cached} = $net->imap_common_init($lei); $net->{nn_cached} = $net->nntp_common_init($lei); |