From: Eric Wong Date: Tue, 16 Apr 2024 20:56:26 +0000 (+0000) Subject: v2 + lei/store: always wait for fast-import checkpoint X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b536768f828b12293ecd57ba93ecfa135fc2c77;p=thirdparty%2Fpublic-inbox.git v2 + lei/store: always wait for fast-import checkpoint 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. --- diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm index 2eb09eca3..0df2352c2 100644 --- a/lib/PublicInbox/LeiStore.pm +++ b/lib/PublicInbox/LeiStore.pm @@ -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); } diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index fb2593961..43f37f602 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -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};