diff options
author | Eric Wong <e@80x24.org> | 2024-05-07 19:14:27 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-05-08 06:00:01 +0000 |
commit | cf3df165033bf36631bd890fa2375339cd95c593 (patch) | |
tree | 03ea43332c4b2ad8b1e0d22b7332269098cfb921 /lib/PublicInbox/xap_helper.h | |
parent | b99860c560a6a4a79c73015612c855d978c3e00e (diff) | |
download | public-inbox-cf3df165033bf36631bd890fa2375339cd95c593.tar.gz |
Reopening Xapian DBs is a fairly cheap operation and Xapian avoids doing work when nothing's changed, so just do it to ensure we always get the latest updates in search results. The old synchronous search interface worked around this by having a timer based expiration in hopes of mitigating fragmentation problems, but perhaps that's not worth doing anymore now that memory fragmentation from Perl itself is better understood.
Diffstat (limited to 'lib/PublicInbox/xap_helper.h')
-rw-r--r-- | lib/PublicInbox/xap_helper.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h index bdc1c5b1..a30a8768 100644 --- a/lib/PublicInbox/xap_helper.h +++ b/lib/PublicInbox/xap_helper.h @@ -712,6 +712,7 @@ static void dispatch(struct req *req) req->srch = *s; if (req->srch != kbuf.srch) { // reuse existing free_srch(kbuf.srch); + req->srch->db->reopen(); } else if (!srch_init(req)) { assert(kbuf.srch == *((struct srch **)tfind( kbuf.srch, &srch_tree, srch_cmp))); |