about summary refs log tree commit homepage
path: root/lib/PublicInbox/V2Writable.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-10-27 07:54:19 +0000
committerEric Wong <e@80x24.org>2020-11-07 10:18:49 +0000
commit2a084f92fa8d2f8f9ea4c0c3463e9b0607ff73c9 (patch)
tree2f83f9cd88a4a0934d61f836b063255fdf6f19e3 /lib/PublicInbox/V2Writable.pm
parente9d7314f0bf0d13206f60c676d5c2914fdfd1670 (diff)
downloadpublic-inbox-2a084f92fa8d2f8f9ea4c0c3463e9b0607ff73c9.tar.gz
ExtSearchIdx will not have Msgmap, since it may index
non email blobs in the future (it'll still be usable
with IMAP, but not NNTP).
Diffstat (limited to 'lib/PublicInbox/V2Writable.pm')
-rw-r--r--lib/PublicInbox/V2Writable.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index f8b7abe1..867e4d2b 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -609,10 +609,11 @@ sub checkpoint ($;$) {
         }
         my $shards = $self->{idx_shards};
         if ($shards) {
-                my $dbh = $self->{mm}->{dbh};
+                my $mm = $self->{mm};
+                my $dbh = $mm->{dbh} if $mm;
 
                 # SQLite msgmap data is second in importance
-                $dbh->commit;
+                $dbh->commit if $dbh;
 
                 # SQLite overview is third
                 $self->{oidx}->commit_lazy;
@@ -632,11 +633,12 @@ sub checkpoint ($;$) {
 
                 # last_commit is special, don't commit these until
                 # Xapian shards are done:
-                $dbh->begin_work;
+                $dbh->begin_work if $dbh;
                 set_last_commits($self);
-                $dbh->commit;
-
-                $dbh->begin_work;
+                if ($dbh) {
+                        $dbh->commit;
+                        $dbh->begin_work;
+                }
         }
         $self->{total_bytes} += $self->{transact_bytes};
         $self->{transact_bytes} = 0;