about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiXSearch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-26 06:29:35 +0200
committerEric Wong <e@80x24.org>2021-03-26 19:58:20 +0000
commitc1e8f5b1a5da1606871f39d4ea260949b6611177 (patch)
treea5f7a0b3a6c5c89fb0d7505754896c4f492ded7c /lib/PublicInbox/LeiXSearch.pm
parent0505a8f75b9855faac6ac913306a3a4e679a6bec (diff)
downloadpublic-inbox-c1e8f5b1a5da1606871f39d4ea260949b6611177.tar.gz
We'll also hoist wait_startq out of the per-message loops
since it's not worth having to check every single message
when filling in smsg info is reasonably fast, anyways.
Diffstat (limited to 'lib/PublicInbox/LeiXSearch.pm')
-rw-r--r--lib/PublicInbox/LeiXSearch.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm
index 58b6cfc0..386c4eba 100644
--- a/lib/PublicInbox/LeiXSearch.pm
+++ b/lib/PublicInbox/LeiXSearch.pm
@@ -156,6 +156,7 @@ sub query_thread_mset { # for --threads
                 $mset = $srch->mset($mo->{qstr}, $mo);
                 mset_progress($lei, $desc, $mset->size,
                                 $mset->get_matches_estimated);
+                wait_startq($lei); # wait for keyword updates
                 my $ids = $srch->mset_to_artnums($mset, $mo);
                 my $ctx = { ids => $ids };
                 my $i = 0;
@@ -165,7 +166,6 @@ sub query_thread_mset { # for --threads
                                 my $smsg = $over->get_art($n) or next;
                                 my $mitem = delete $n2item{$smsg->{num}};
                                 next if $smsg->{bytes} == 0;
-                                wait_startq($lei); # wait for keyword updates
                                 if ($mitem) {
                                         if ($can_kw) {
                                                 mitem_kw($smsg, $mitem, $fl);
@@ -196,9 +196,9 @@ sub query_mset { # non-parallel for non-"--threads" users
                 $mset = $self->mset($mo->{qstr}, $mo);
                 mset_progress($lei, 'xsearch', $mset->size,
                                 $mset->size, $mset->get_matches_estimated);
+                wait_startq($lei); # wait for keyword updates
                 for my $mitem ($mset->items) {
                         my $smsg = smsg_for($self, $mitem) or next;
-                        wait_startq($lei);
                         $each_smsg->($smsg, $mitem);
                 }
         } while (_mset_more($mset, $mo));