diff options
author | Eric Wong <e@80x24.org> | 2021-04-05 10:27:52 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-05 19:10:16 +0000 |
commit | 78b7e158b5a8391db2fc3420fa9f99d2be7648d2 (patch) | |
tree | b8d94ec60a7dd2fa4d56cc623667f45f024a2ec5 /lib/PublicInbox/LeiOverview.pm | |
parent | c608b3422b2c17c6572966cfbc11b2e6ce4854e1 (diff) | |
download | public-inbox-78b7e158b5a8391db2fc3420fa9f99d2be7648d2.tar.gz |
IMAP authentication info is only shared amongst lei2mail workers, so we must ensure all IMAP writes go through lei2mail workers even if we don't have to access the mail through git. This allows us to decouple the latency of the remote mboxrd from the latency of the IMAP --output at the expense of extra IPC overhead within our own processes.
Diffstat (limited to 'lib/PublicInbox/LeiOverview.pm')
-rw-r--r-- | lib/PublicInbox/LeiOverview.pm | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index cdd9ee04..bfb8b143 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -195,7 +195,7 @@ sub _json_pretty { } sub ovv_each_smsg_cb { # runs in wq worker usually - my ($self, $lei, $ibxish) = @_; + my ($self, $lei) = @_; my ($json, $dedupe); if (my $pkg = $self->{json}) { $json = $pkg->new; @@ -208,17 +208,11 @@ sub ovv_each_smsg_cb { # runs in wq worker usually $dedupe->prepare_dedupe; } $lei->{ovv_buf} = \(my $buf = '') if !$l2m; - if ($l2m && !$ibxish) { # remote https?:// mboxrd - my $wcb = $l2m->write_cb($lei); - sub { - my ($smsg, undef, $eml) = @_; # no mitem in $_[1] - $wcb->(undef, $smsg, $eml); - }; - } elsif ($l2m && $l2m->{-wq_s1}) { + if ($l2m) { sub { - my ($smsg, $mitem) = @_; + my ($smsg, $mitem, $eml) = @_; $smsg->{pct} = get_pct($mitem) if $mitem; - $l2m->wq_io_do('write_mail', [], $smsg); + $l2m->wq_io_do('write_mail', [], $smsg, $eml); } } elsif ($self->{fmt} =~ /\A(concat)?json\z/ && $lei->{opt}->{pretty}) { my $EOR = ($1//'') eq 'concat' ? "\n}" : "\n},"; |