]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
v2writable: checkpoint: clarify $dbh is for msgmap
authorEric Wong <e@80x24.org>
Tue, 26 Aug 2025 19:50:39 +0000 (19:50 +0000)
committerEric Wong <e@80x24.org>
Thu, 28 Aug 2025 18:48:10 +0000 (18:48 +0000)
We overload the checkpoint sub for -extindex, however only v2 has
msgmap.sqlite3 so we'll avoid confusing ourselves with with a
generic `$dbh' name in favor of `$mm_dbh'.

lib/PublicInbox/V2Writable.pm

index 62895af2bebee71ee4ae8b5eb46b1e801b3e0802..7241cfc1e00847666c0173a7ee88d2db22ba3420 100644 (file)
@@ -518,7 +518,7 @@ sub checkpoint ($;$) {
        my $shards = $self->{idx_shards};
        if ($shards) {
                # SQLite msgmap is second in importance (not in eidx)
-               my $dbh = $self->{mm} ? $self->{mm}->mm_commit : undef;
+               my $mm_dbh = $self->{mm} ? $self->{mm}->mm_commit : undef;
 
                # SQLite overview is third
                $self->{oidx}->commit_lazy;
@@ -552,11 +552,11 @@ shard[$i] bad echo:$echo != $i waiting for txn commit
 
                # last_commit is special, don't commit these until
                # Xapian shards are done:
-               $dbh->begin_work if $dbh;
+               $mm_dbh->begin_work if $mm_dbh;
                set_last_commits($self);
-               if ($dbh) {
-                       $dbh->commit;
-                       $dbh->begin_work;
+               if ($mm_dbh) {
+                       $mm_dbh->commit;
+                       $mm_dbh->begin_work;
                }
        }
        delete $self->{next_checkpoint};