]> Sergey Matveev's repositories - public-inbox.git/commitdiff
admin: use a generic variable name
authorEric Wong <e@yhbt.net>
Mon, 10 Aug 2020 02:11:59 +0000 (02:11 +0000)
committerEric Wong <e@yhbt.net>
Mon, 10 Aug 2020 06:26:09 +0000 (06:26 +0000)
We parse other options, too, not just --max-size

Documentation/public-inbox-index.pod
lib/PublicInbox/Admin.pm

index 3ae3b0089275a5a60195cd169f12d65c6019fdbe..10cf2d19b6d052da8e57630b2f6ac1004b80827e 100644 (file)
@@ -179,7 +179,7 @@ C<4m> have little benefit.
 For L<public-inbox-v2-format(5)> inboxes, this value is
 multiplied by the number of Xapian shards.  Thus a typical v2
 inbox with 3 shards will flush every 3 megabytes by default
-when unless parallelism is disabled via C<--sequential-shard>
+unless parallelism is disabled via C<--sequential-shard>
 or C<--jobs=0>.
 
 This influences memory usage of Xapian, but it is not exact.
index af2b3da95c3406bfe3dd53fdd062b08895dd6f3a..8a9a81c91180bd0f315a5440df7ba01df1adfe4c 100644 (file)
@@ -256,12 +256,12 @@ sub progress_prepare ($) {
 
 # same unit factors as git:
 sub parse_unsigned ($) {
-       my ($max_size) = @_;
+       my ($val) = @_;
 
-       $$max_size =~ /\A([0-9]+)([kmg])?\z/i or return;
+       $$val =~ /\A([0-9]+)([kmg])?\z/i or return;
        my ($n, $unit_factor) = ($1, $2 // '');
        my %u = ( k => 1024, m => 1024**2, g => 1024**3 );
-       $$max_size = $n * ($u{lc($unit_factor)} // 1);
+       $$val = $n * ($u{lc($unit_factor)} // 1);
        1;
 }