From 6fb0ce0b872baa1d2d7cb7e37e6282b2cd58feb6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 25 May 2020 03:30:20 +0000 Subject: msgmap: tmp_clone: use in-memory journal 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") --- lib/PublicInbox/Msgmap.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib') 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: $!"; -- cgit v1.2.3-24-ge0c7