From f977826a17f8735e6947dd2da380df8c6d0b38d8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 24 Jun 2020 18:45:07 +0000 Subject: lock: reduce inotify wakeups 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). --- lib/PublicInbox/Import.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/Import.pm') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index af35905b..ae508cd8 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -468,9 +468,9 @@ sub done { waitpid($pid, 0) == $pid or die 'fast-import did not finish'; $? == 0 or die "fast-import failed: $?"; - _update_git_info($self, 1) if delete $self->{nchg}; - - $self->lock_release; + my $nchg = delete $self->{nchg}; + _update_git_info($self, 1) if $nchg; + $self->lock_release(!!$nchg); $self->{git}->cleanup; } -- cgit v1.2.3-24-ge0c7