]> Sergey Matveev's repositories - public-inbox.git/commitdiff
index: fix --no-fsync flag propagation to extindex
authorEric Wong <e@80x24.org>
Fri, 25 Dec 2020 10:21:13 +0000 (10:21 +0000)
committerEric Wong <e@80x24.org>
Sat, 26 Dec 2020 06:22:56 +0000 (06:22 +0000)
Negation in flag names are confusing, but trying to deviate from
the DB_NO_SYNC name used by Xapian is also confusing.

lib/PublicInbox/ExtSearchIdx.pm
script/public-inbox-index

index 3f197973c9fcb612b3f3f4db25a0d2be50bd94e0..e7fdae48ed79ac4f9eecdd14caac8cf8ea98976d 100644 (file)
@@ -54,7 +54,7 @@ sub new {
        }, __PACKAGE__;
        $self->{shards} = $self->count_shards || nproc_shards($opt->{creat});
        my $oidx = PublicInbox::OverIdx->new("$self->{xpfx}/over.sqlite3");
-       $oidx->{-no_fsync} = 1 if $opt->{-no_fsync};
+       $self->{-no_fsync} = $oidx->{-no_fsync} = 1 if !$opt->{fsync};
        $self->{oidx} = $oidx;
        $self
 }
index a17bf615a0e226266ee73f139e1d5e8d22bc99d6..c68f922447293bb0b43782e7795d57e9c7387ba0 100755 (executable)
@@ -85,7 +85,7 @@ for my $ei_name (@$update_extindex) {
                die "extindex `$ei_name' not configured or found\n";
        }
        $eidx_seen{$topdir} //=
-               push(@eidx, PublicInbox::ExtSearchIdx->new($topdir));
+               push(@eidx, PublicInbox::ExtSearchIdx->new($topdir, $opt));
 }
 my $mods = {};
 my @eidx_unconfigured;
@@ -141,7 +141,6 @@ EOL
                $eidx->attach_inbox($ibx);
        }
 }
-$opt->{-no_fsync} = 1 if !$opt->{fsync};
 my $pr = $opt->{-progress};
 for my $eidx (@eidx) {
        $pr->("indexing $eidx->{topdir} ...\n") if $pr;