]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_mirror: do not needlessly rewrite project-list
authorEric Wong <e@80x24.org>
Fri, 6 Jan 2023 11:51:33 +0000 (11:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 6 Jan 2023 20:21:36 +0000 (20:21 +0000)
No need to cause extra wear on storage devices.

lib/PublicInbox/LeiMirror.pm

index db249eceff64bc759b619ddb4f9c5e6a9cf1f180..87abf88c8e1a03f4559b7d0f0251019afb52b7f5 100644 (file)
@@ -1056,7 +1056,8 @@ EOM
 
        my (undef, $dn, $bn) = File::Spec->splitpath($f);
        $self->{chg}->{nr_chg} += scalar(@remote) + scalar(@local);
-       atomic_write($dn, $bn, join("\n", @list, ''));
+       my $new = join("\n", @list, '');
+       atomic_write($dn, $bn, $new) if $new ne $old;
 }
 
 # FIXME: this gets confused by single inbox instance w/ global manifest.js.gz