]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
v2 + lei/store: always wait for fast-import checkpoint
authorEric Wong <e@80x24.org>
Tue, 16 Apr 2024 20:56:26 +0000 (20:56 +0000)
committerEric Wong <e@80x24.org>
Wed, 17 Apr 2024 09:22:51 +0000 (09:22 +0000)
Since data going to git is the most important, always ensure
data is written to git before attempting to write anything to
SQLite or Xapian.

lib/PublicInbox/LeiStore.pm
lib/PublicInbox/V2Writable.pm

index 2eb09eca39e9f6ff311a3e8439f7b7acba70dcda..0df2352c23b7ae9b437950785aa2ebc1324e567b 100644 (file)
@@ -573,9 +573,7 @@ sub set_xvmd {
 
 sub checkpoint {
        my ($self, $wait) = @_;
-       if (my $im = $self->{im}) {
-               $wait ? $im->barrier : $im->checkpoint;
-       }
+       $self->{im}->barrier if $self->{im};
        delete $self->{lms};
        $self->{priv_eidx}->checkpoint($wait);
 }
index fb2593961c1876c51e9e1a70287017d8e248341c..43f37f6021beb8f3922099c8630e08707bc4b271 100644 (file)
@@ -507,13 +507,7 @@ sub set_last_commits ($) { # this is NOT for ExtSearchIdx
 sub checkpoint ($;$) {
        my ($self, $wait) = @_;
 
-       if (my $im = $self->{im}) {
-               if ($wait) {
-                       $im->barrier;
-               } else {
-                       $im->checkpoint;
-               }
-       }
+       $self->{im}->barrier if $self->{im};
        my $shards = $self->{idx_shards};
        if ($shards) {
                my $dbh = $self->{mm}->{dbh} if $self->{mm};