about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-04-16 20:56:26 +0000
committerEric Wong <e@80x24.org>2024-04-17 09:22:51 +0000
commit6b536768f828b12293ecd57ba93ecfa135fc2c77 (patch)
treea3b1392389438391710b8629ed2473aa91612dec /lib
parentcd14eec87ae870f388ac24c2390e1c608fbed99c (diff)
downloadpublic-inbox-6b536768f828b12293ecd57ba93ecfa135fc2c77.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/LeiStore.pm4
-rw-r--r--lib/PublicInbox/V2Writable.pm8
2 files changed, 2 insertions, 10 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 2eb09eca..0df2352c 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 fb259396..43f37f60 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};