]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei_mirror: do not re-fetch inbox.config.example
authorEric Wong <e@80x24.org>
Mon, 13 Mar 2023 12:00:21 +0000 (12:00 +0000)
committerEric Wong <e@80x24.org>
Mon, 13 Mar 2023 12:45:55 +0000 (12:45 +0000)
It's a significant source of latency for incremental updates at
the moment, and not really needed since it's just an example.

lib/PublicInbox/LeiMirror.pm

index d878f1e488f97bf447b3722fc15d410ff85a9a70..967a6422dbea0f6a416223414966009332204509 100644 (file)
@@ -620,7 +620,8 @@ sub clone_v1 {
                                                \&run_puh, $self, $fini));
        }
        if (!$self->{-is_epoch} && $lei->{opt}->{'inbox-config'} =~
-                               /\A(?:always|v1)\z/s) {
+                               /\A(?:always|v1)\z/s &&
+                       !-f "$dst/inbox.config.example") {
                _get_txt_start($self, '_/text/config/raw', $fini);
        }
 
@@ -923,8 +924,10 @@ failed to extract epoch number from $src
 
        $self->{dry_run} or File::Path::mkpath($dst);
 
-       $lei->{opt}->{'inbox-config'} =~ /\A(?:always|v2)\z/s and
+       if ($lei->{opt}->{'inbox-config'} =~ /\A(?:always|v2)\z/s &&
+                       !-f "$dst/inbox.config.example") {
                _get_txt_start($task, '_/text/config/raw', $fini);
+       }
 
        defined($desc) ? ($task->{'txt.description'} = $desc) :
                _get_txt_start($task, 'description', $fini);