about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-05 21:45:27 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-06 21:18:37 +0000
commit9d6468d9560b8cd26ba2529d7a09a93ec5ad8c00 (patch)
tree3397a3eec38a05faab1ea05b50baf71a65439504 /script
parent42b780f1d728b702c01181d6adbee34c8f395788 (diff)
downloadpublic-inbox-9d6468d9560b8cd26ba2529d7a09a93ec5ad8c00.tar.gz
Some of this jankiness was from early performance problems
and they turned out to be unnecessary measures.
Diffstat (limited to 'script')
-rwxr-xr-xscript/public-inbox-compact13
1 files changed, 5 insertions, 8 deletions
diff --git a/script/public-inbox-compact b/script/public-inbox-compact
index b8aaa4bd..43e94609 100755
--- a/script/public-inbox-compact
+++ b/script/public-inbox-compact
@@ -36,15 +36,12 @@ sub commit_changes ($$$) {
         my ($im, $old, $new) = @_;
         my @st = stat($old) or die "failed to stat($old): $!\n";
 
-        for my $suf (qw(.pipe.lock -journal)) {
-                my $orig = "$old/over.sqlite3$suf";
-                link($orig, "$new/over.sqlite3$suf") and next;
-                next if $!{ENOENT};
-                die "failed to link $orig => $new/over.sqlite3$suf: $!\n";
+        my $over = "$old/over.sqlite3";
+        if (-f $over) {
+                require PublicInbox::Over;
+                $over = PublicInbox::Over->new($over);
+                $over->connect->sqlite_backup_to_file("$new/over.sqlite3");
         }
-        link("$old/over.sqlite3", "$new/over.sqlite3") or die
-                "failed to link {$old => $new}/over.sqlite3: $!\n";
-
         rename($old, "$new/old") or die "rename $old => $new/old: $!\n";
         chmod($st[2] & 07777, $new) or die "chmod $old: $!\n";
         rename($new, $old) or die "rename $new => $old: $!\n";