about summary refs log tree commit homepage
path: root/lib/PublicInbox/Import.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-19 08:14:34 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-19 08:16:34 +0000
commitad281240644ee370c75d95b35ad7833863257286 (patch)
treefd8b3a3d57b7f0115fb91c4ecefa42d5b93a826b /lib/PublicInbox/Import.pm
parentdd83a896a7eb718dcd49560d0aab967f1f481883 (diff)
downloadpublic-inbox-ad281240644ee370c75d95b35ad7833863257286.tar.gz
Stopping and starting a bunch of processes to look up duplicates
or removals is inefficient.  Take advantage of checkpointing
in "git fast-import" and transactions in Xapian and SQLite.
Diffstat (limited to 'lib/PublicInbox/Import.pm')
-rw-r--r--lib/PublicInbox/Import.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index 664bec69..8406c9e2 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -133,7 +133,6 @@ sub check_remove_v1 {
         (undef, $cur);
 }
 
-# used for v2 (maybe)
 sub checkpoint {
         my ($self) = @_;
         return unless $self->{pid};
@@ -141,6 +140,15 @@ sub checkpoint {
         undef;
 }
 
+sub progress {
+        my ($self, $msg) = @_;
+        return unless $self->{pid};
+        print { $self->{out} } "progress $msg\n" or wfail;
+        $self->{in}->getline eq "progress $msg\n" or die
+                "progress $msg not received\n";
+        undef;
+}
+
 # used for v2
 sub get_mark {
         my ($self, $mark) = @_;