From: Eric Wong Date: Fri, 6 Jan 2023 11:51:33 +0000 (+0000) Subject: lei_mirror: do not needlessly rewrite project-list X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=0ec1d189ea5657919662a5acb6bb70b6616c3584;ds=sidebyside lei_mirror: do not needlessly rewrite project-list No need to cause extra wear on storage devices. --- diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index db249ece..87abf88c 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -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