diff options
author | Eric Wong <e@80x24.org> | 2015-08-17 16:49:31 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-17 17:46:56 +0000 |
commit | cc22505339e40fe45113ee39a4688070807eba58 (patch) | |
tree | 072d2d783d99e38056326b5c27043e5236ae9595 /public-inbox-index | |
parent | c59caac2ee502dfd8b3acb1ca268c597719313f8 (diff) | |
download | public-inbox-cc22505339e40fe45113ee39a4688070807eba58.tar.gz |
There's no need to make a transaction for each message when doing incremental indexing against a git repository. While we're at it, simplify the interface for callers, too and do not auto-create the Xapian database if it was not explicitly enabled.
Diffstat (limited to 'public-inbox-index')
-rwxr-xr-x | public-inbox-index | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/public-inbox-index b/public-inbox-index index 9cfcadc2..2fcf5627 100755 --- a/public-inbox-index +++ b/public-inbox-index @@ -10,8 +10,11 @@ use strict; use warnings; my $usage = "public-inbox-index GIT_DIR"; use PublicInbox::Config; -use PublicInbox::Search; -use PublicInbox::GitCatFile; +eval { require PublicInbox::Search }; +if ($@) { + print STDERR "Search::Xapian required for $0\n"; + exit 1; +} sub usage { print STDERR "Usage: $usage\n"; exit 1 } if (@ARGV) { @@ -23,7 +26,6 @@ if (@ARGV) { sub index_dir { my ($git_dir) = @_; -d $git_dir or die "$git_dir does not appear to be a git repository\n"; - my $git = PublicInbox::GitCatFile->new($git_dir); my $s = PublicInbox::Search->new($git_dir, 1); - $s->index_sync($git); + $s->index_sync; } |