about summary refs log tree commit homepage
path: root/lib/PublicInbox/Msgmap.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-05-25 03:30:20 +0000
committerEric Wong <e@yhbt.net>2020-05-26 10:54:39 +0000
commit6fb0ce0b872baa1d2d7cb7e37e6282b2cd58feb6 (patch)
tree4801aa5854bfec71a8ec19271b36fa14fcc37e4d /lib/PublicInbox/Msgmap.pm
parent8604ccc806997eadf78e2b6352b4daa0287b8bb0 (diff)
downloadpublic-inbox-6fb0ce0b872baa1d2d7cb7e37e6282b2cd58feb6.tar.gz
This prevents $TMPDIR from being littered with *-journal files
after running the test suite.

This shouldn't cause excessive memory use since $v2w->{mm_tmp}
doesn't see big transactions.  There's no need to worry about
data loss, here,either, since this is just a temporary clone
we've even disabled fsync on.

Fixes: 78888d36fb80889f ("msgmap: use TRUNCATE for journal_mode, for now")
Diffstat (limited to 'lib/PublicInbox/Msgmap.pm')
-rw-r--r--lib/PublicInbox/Msgmap.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/PublicInbox/Msgmap.pm b/lib/PublicInbox/Msgmap.pm
index 5fe14383..a2ffe720 100644
--- a/lib/PublicInbox/Msgmap.pm
+++ b/lib/PublicInbox/Msgmap.pm
@@ -70,6 +70,7 @@ sub tmp_clone {
         $self->{dbh}->sqlite_backup_to_file($fn);
         my $tmp = ref($self)->new_file($fn, 1);
         $tmp->{dbh}->do('PRAGMA synchronous = OFF');
+        $tmp->{dbh}->do('PRAGMA journal_mode = MEMORY');
         $tmp->{tmp_name} = $fn; # SQLite won't work if unlinked, apparently
         $tmp->{pid} = $$;
         close $fh or die "failed to close $fn: $!";