]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiMailSync.pm
index: optimize after all SQLite DB commits
[public-inbox.git] / lib / PublicInbox / LeiMailSync.pm
index 91cd1c934a1fa7889d293574d99df9878a53292f..f7e37ad9ca808ce3b618d651366c3e2a0e28aeb3 100644 (file)
@@ -47,7 +47,8 @@ sub lms_write_prepare { ($_[0]->{dbh} //= dbh_new($_[0], 1)); $_[0] }
 sub lms_pause {
        my ($self) = @_;
        $self->{fmap} = {};
-       delete $self->{dbh};
+       my $dbh = delete $self->{dbh};
+       eval { $dbh->do('PRAGMA optimize') } if $dbh;
 }
 
 sub create_tables {