diff options
author | Eric Wong <e@80x24.org> | 2021-03-26 09:51:23 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-03-26 21:51:30 +0000 |
commit | 4aaf4890790f32e7bb1a091cbb7fe40cb0abe90e (patch) | |
tree | 6530776c106f1591855561ffeac2f5a69cd8a306 /lib/PublicInbox/LeiOverview.pm | |
parent | 90ca1ac28edb2e8a64c30bb4be723643c646df89 (diff) | |
download | public-inbox-4aaf4890790f32e7bb1a091cbb7fe40cb0abe90e.tar.gz |
lei q: skip lei/store->write_prepare for JSON outputs
JSON outputs won't write to lei/store at all, so there's no point in forking the store worker if it's not already running. LeiSearch object ($lse) is also fork-safe until it opens a persistent FD for Xapian/SQLite so we can unconditionally carry it across fork.
Diffstat (limited to 'lib/PublicInbox/LeiOverview.pm')
-rw-r--r-- | lib/PublicInbox/LeiOverview.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index b4d81328..96bfff24 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -223,7 +223,7 @@ sub ovv_each_smsg_cb { # runs in wq worker usually } } elsif ($self->{fmt} =~ /\A(concat)?json\z/ && $lei->{opt}->{pretty}) { my $EOR = ($1//'') eq 'concat' ? "\n}" : "\n},"; - my $lse = $lei->{sto}->search; + my $lse = $lei->{lse}; sub { # DIY prettiness :P my ($smsg, $mitem) = @_; return if $dedupe->is_smsg_dup($smsg); @@ -247,7 +247,7 @@ sub ovv_each_smsg_cb { # runs in wq worker usually } } elsif ($json) { my $ORS = $self->{fmt} eq 'json' ? ",\n" : "\n"; # JSONL - my $lse = $lei->{sto}->search; + my $lse = $lei->{lse}; sub { my ($smsg, $mitem) = @_; return if $dedupe->is_smsg_dup($smsg); |