From 78d765a8d03967d0dfd6ce6232ffad5c89319909 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 17 Jun 2016 01:56:05 +0000 Subject: import: auto-update index when done This prevents multiple update processes from stepping over each other while called under the lock, and also allows the new -watch process to update the index iff indexing was desired. --- lib/PublicInbox/Import.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/PublicInbox/Import.pm') diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index e3d65f4a..c13d4834 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -226,6 +226,11 @@ sub done { waitpid($pid, 0) == $pid or die 'update-server-info did not finish'; $? == 0 or die "failed to update-server-info: $?\n"; + + eval { + require PublicInbox::SearchIdx; + PublicInbox::SearchIdx->new($git_dir, 2)->index_sync; + }; } my $lockfh = delete $self->{lockfh} or die "BUG: not locked: $!"; -- cgit v1.2.3-24-ge0c7