]> Sergey Matveev's repositories - public-inbox.git/commitdiff
msgmap: tmp_clone: use MEMORY journal upon reconnect
authorEric Wong <e@yhbt.net>
Thu, 6 Aug 2020 10:37:10 +0000 (10:37 +0000)
committerEric Wong <e@80x24.org>
Thu, 6 Aug 2020 21:11:38 +0000 (21:11 +0000)
Since reindexing releases the DB handle every indexBatchSize bytes,
we need to ensure we keep the journal in-memory when reopening
the DB since this is throwaway data.

lib/PublicInbox/Msgmap.pm

index c85e7796cbd4512f2c286628a4eff8f04aed9388..eee8d6ca58b96adbb46746c1c23c848154ee804c 100644 (file)
@@ -248,6 +248,7 @@ sub atfork_parent {
        $self->{dbh} and die 'BUG: tmp_clone dbh not prepared for parent';
        defined($self->{filename}) or die 'BUG: {filename} not defined';
        $self->{dbh} = PublicInbox::Over::dbh_new($self, 2);
+       $self->{dbh}->do('PRAGMA journal_mode = MEMORY');
 }
 
 sub atfork_prepare {