about summary refs log tree commit homepage
path: root/lib/PublicInbox/Import.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-17 01:56:05 +0000
committerEric Wong <e@80x24.org>2016-06-17 01:57:26 +0000
commit78d765a8d03967d0dfd6ce6232ffad5c89319909 (patch)
tree7d18fefbd3fcf72ca44133c5e3f96b2df2a7c489 /lib/PublicInbox/Import.pm
parent2f69c2938a9f6bd36740f050c9e2661206b17c34 (diff)
downloadpublic-inbox-78d765a8d03967d0dfd6ce6232ffad5c89319909.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r--lib/PublicInbox/Import.pm5
1 files changed, 5 insertions, 0 deletions
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: $!";