about summary refs log tree commit homepage
path: root/script/public-inbox-xcpdb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-05-23 09:37:00 +0000
committerEric Wong <e@80x24.org>2019-05-23 17:43:50 +0000
commitc7380dad6bb9eab26641c5ec2707431ed573de3c (patch)
tree39f97521df166ace6abb6b7140a1b6b82d1b2793 /script/public-inbox-xcpdb
parented52051030b89985a1ec032ed4acc74912b0dd80 (diff)
downloadpublic-inbox-c7380dad6bb9eab26641c5ec2707431ed573de3c.tar.gz
Since -xcpdb is a superset of -compact, we can reuse much of
that code used for driving compact.

For compact (only), this is slightly less memory efficient since
it requires an extra process per-partition, but we get to prefix
the output with the partition name for more readable output.
Diffstat (limited to 'script/public-inbox-xcpdb')
-rwxr-xr-xscript/public-inbox-xcpdb3
1 files changed, 1 insertions, 2 deletions
diff --git a/script/public-inbox-xcpdb b/script/public-inbox-xcpdb
index 5b66337b..bda7be0c 100755
--- a/script/public-inbox-xcpdb
+++ b/script/public-inbox-xcpdb
@@ -11,9 +11,8 @@ my $usage = "Usage: public-inbox-xcpdb INBOX_DIR\n";
 my $opt = {};
 GetOptions($opt, qw(compact quiet|q)) or die "bad command-line args\n$usage";
 my @ibxs = PublicInbox::Admin::resolve_inboxes(\@ARGV) or die $usage;
-my $cmd = [ \&PublicInbox::Xapcmd::cpdb ];
 foreach (@ibxs) {
         my $ibx = PublicInbox::InboxWritable->new($_);
         # we rely on --no-renumber to keep docids synched to NNTP
-        PublicInbox::Xapcmd::run($ibx, $cmd, undef, $opt);
+        PublicInbox::Xapcmd::run($ibx, 'cpdb', $opt);
 }