diff options
author | Eric Wong <e@yhbt.net> | 2020-07-24 05:56:02 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-07-25 20:48:18 +0000 |
commit | 0e68dbad3dc5e3fbc44e8ba8be576b81455d3359 (patch) | |
tree | dfe57fccc97fdf43ce68f3ae6f5cc804a00520df /script/public-inbox-index | |
parent | de8e1586d732ae6c09a92588a8e4d442aedbff37 (diff) | |
download | public-inbox-0e68dbad3dc5e3fbc44e8ba8be576b81455d3359.tar.gz |
This allows us to speed up indexing operations to SQLite and Xapian. Unfortunately, it doesn't affect operations using `xapian-compact' and the compactor API, since that doesn't seem to support Xapian::DB_NO_SYNC, yet.
Diffstat (limited to 'script/public-inbox-index')
-rwxr-xr-x | script/public-inbox-index | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/script/public-inbox-index b/script/public-inbox-index index 2e1934b0..d5c7cae2 100755 --- a/script/public-inbox-index +++ b/script/public-inbox-index @@ -14,8 +14,8 @@ PublicInbox::Admin::require_or_die('-index'); use PublicInbox::Xapcmd; my $compact_opt; -my $opt = { quiet => -1, compact => 0, maxsize => undef }; -GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i prune +my $opt = { quiet => -1, compact => 0, maxsize => undef, sync => 1 }; +GetOptions($opt, qw(verbose|v+ reindex rethread compact|c+ jobs|j=i prune sync! indexlevel|L=s maxsize|max-size=s batchsize|batch-size=s)) or die "bad command-line args\n$usage"; die "--jobs must be >= 0\n" if defined $opt->{jobs} && $opt->{jobs} < 0; @@ -59,6 +59,7 @@ for my $ibx (@ibxs) { if ($opt->{compact} >= 2) { PublicInbox::Xapcmd::run($ibx, 'compact', $compact_opt); } + $ibx->{-no_sync} = 1 if !$opt->{sync}; PublicInbox::Admin::index_inbox($ibx, undef, $opt); PublicInbox::Xapcmd::run($ibx, 'compact', $compact_opt) if $compact_opt; } |