From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id BC1F21F47C for ; Fri, 6 Jan 2023 11:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673005892; bh=5nwSNIGLUSvaRysmbTHoBnG3ymdwwIYyL28G9lY9kBQ=; h=From:To:Subject:Date:From; b=Vhp7Re68O0Tj1tKajJFW90pkY0Cz/PnmHENTiFo1FdBtkT6y3xtT3XU3Zem5acCgr VUD//U942NDUCBoaNuyhffOSZxnlXroDaHONEBzsidJn0MW46ZNYVRqC/0FZigDMKP dG0dN9YLOBTN/QE+AW+4osizJSA7qZGA0KB1rxHc= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] lei_mirror: do not needlessly rewrite project-list Date: Fri, 6 Jan 2023 11:51:33 +0000 Message-Id: <20230106115133.2370083-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: No need to cause extra wear on storage devices. --- lib/PublicInbox/LeiMirror.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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