about summary refs log tree commit homepage
path: root/lib/PublicInbox/Mbox.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-08-20 20:24:43 +0000
committerEric Wong <e@yhbt.net>2020-08-20 21:11:13 +0000
commit4d8a07616ebe29771c9775173e9d01a91ec677ae (patch)
treebdcb09572eda8eaf16c7d5f537798b5e7112ea75 /lib/PublicInbox/Mbox.pm
parent11f44fc4381899f703f0bac15a8c40dfd652873c (diff)
downloadpublic-inbox-4d8a07616ebe29771c9775173e9d01a91ec677ae.tar.gz
While this is unlikely to be a problem in current practice,
keeping Xapian DBs open for long responses can interfere with
free space recovery after -compact.

In the future, it will interfere with inbox search grouping
and lead to unexpected results.
Diffstat (limited to 'lib/PublicInbox/Mbox.pm')
-rw-r--r--lib/PublicInbox/Mbox.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index fc83a893..a83c0356 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -205,8 +205,8 @@ sub mbox_all_ids {
 
 sub results_cb {
         my ($ctx) = @_;
+        my $srch = $ctx->{-inbox}->search(undef, $ctx) or return;
         my $mset = $ctx->{mset};
-        my $srch = $ctx->{srch};
         while (1) {
                 while (my $mi = (($mset->items)[$ctx->{iter}++])) {
                         my $smsg = PublicInbox::Smsg::from_mitem($mi,
@@ -227,8 +227,8 @@ sub mbox_all {
 
         return mbox_all_ids($ctx) if $query eq '';
         my $qopts = $ctx->{qopts} = { mset => 2 };
-        my $srch = $ctx->{srch} = $ctx->{-inbox}->search or
-                return PublicInbox::WWW::need($ctx, 'Search');;
+        my $srch = $ctx->{-inbox}->search or
+                return PublicInbox::WWW::need($ctx, 'Search');
         my $mset = $ctx->{mset} = $srch->query($query, $qopts);
         $qopts->{offset} = $mset->size or
                         return [404, [qw(Content-Type text/plain)],