about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-24 18:45:07 +0000
committerEric Wong <e@yhbt.net>2020-06-25 05:37:45 +0000
commitf977826a17f8735e6947dd2da380df8c6d0b38d8 (patch)
treea3879cdbfd7ba1ac32008173d163d8f5f4163fbb /lib/PublicInbox/SearchIdx.pm
parent7601f7d864d74dae58ee248e426527fb2ebe74a5 (diff)
downloadpublic-inbox-f977826a17f8735e6947dd2da380df8c6d0b38d8.tar.gz
We can reduce the amount of platform-specific code by always
relying on IN_MODIFY/NOTE_WRITE notifications from lock release.
This reduces the number of times our read-only daemons will
need to wake up when -watch sees no-op message changes
(e.g. replied, seen, recent flag changes).
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index 00e63938..4caa66d3 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -78,12 +78,12 @@ sub new {
 sub need_xapian ($) { $_[0]->{indexlevel} =~ $xapianlevels }
 
 sub _xdb_release {
-        my ($self) = @_;
+        my ($self, $wake) = @_;
         if (need_xapian($self)) {
                 my $xdb = delete $self->{xdb} or croak 'not acquired';
                 $xdb->close;
         }
-        $self->lock_release if $self->{creat};
+        $self->lock_release($wake) if $self->{creat};
         undef;
 }
 
@@ -800,7 +800,7 @@ sub _index_sync {
                 }
                 $self->commit_txn_lazy;
                 $git->cleanup;
-                $xdb = _xdb_release($self);
+                $xdb = _xdb_release($self, $nr);
                 # let another process do some work... <
                 $pr->("indexed $nr/$self->{ntodo}\n") if $pr && $nr;
                 if (!$newest) {