* [PATCH 1/6] clone|fetch: preserve mtime of modified manifest.js.gz
2022-10-20 8:43 5% [PATCH 0/6] trivial clone|fetch-related stuff Eric Wong
@ 2022-10-20 8:43 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-10-20 8:43 UTC (permalink / raw)
To: meta
When we cull manifest.js.gz for ignored epochs, attempt to
preserve mtime of the updated manifest.js.gz since it can
be used to optimize future fetches.
---
lib/PublicInbox/Fetch.pm | 2 ++
lib/PublicInbox/LeiMirror.pm | 2 ++
2 files changed, 4 insertions(+)
diff --git a/lib/PublicInbox/Fetch.pm b/lib/PublicInbox/Fetch.pm
index 5261cad1..364271e8 100644
--- a/lib/PublicInbox/Fetch.pm
+++ b/lib/PublicInbox/Fetch.pm
@@ -221,7 +221,9 @@ EOM
if ($mculled) {
my $json = PublicInbox::Config->json->encode($m1);
my $fn = $ft->filename;
+ my $mtime = (stat($fn))[9];
gzip(\$json => $fn) or die "gzip: $GzipError";
+ utime($mtime, $mtime, $fn) or die "utime(..., $fn): $!";
}
PublicInbox::LeiMirror::ft_rename($ft, $mf, 0666);
}
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index e20d30b4..fa1d2e88 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -408,7 +408,9 @@ EOM
# users won't have to delete manifest if they +w an
# epoch they no longer want to skip
my $json = PublicInbox::Config->json->encode($m);
+ my $mtime = (stat($fn))[9];
gzip(\$json => $fn) or die "gzip: $GzipError";
+ utime($mtime, $mtime, $fn) or die "utime(..., $fn): $!";
}
ft_rename($ft, "$self->{dst}/manifest.js.gz", 0666);
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/6] trivial clone|fetch-related stuff
@ 2022-10-20 8:43 5% Eric Wong
2022-10-20 8:43 7% ` [PATCH 1/6] clone|fetch: preserve mtime of modified manifest.js.gz Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-10-20 8:43 UTC (permalink / raw)
To: meta
Much bigger, barely-tested changes in the pipeline to support
cloning + updating multi-inbox mirrors (without unnecessary
sleeps and delays[1]). Here's some trivial stuff first.
Of course, I have a SHA-256 coderepo somewhere, so more
tweaks on that front.
4/6 is the only user-visible change, but hopefully nobody
is parsing stderr.
Eric Wong (6):
clone|fetch: preserve mtime of modified manifest.js.gz
another step towards git SHA-256 support
githttpbackend: remove unused $BIN variable
treewide: replace /^I: / prefix with /^# /
lei_mirror: make _finish_add_external call more obvious
lei_mirror: delimit names by `\n' to improve die message
examples/grok-pull.post_update_hook.sh | 2 +-
lib/PublicInbox/ExtSearchIdx.pm | 26 ++++++++++++--------------
lib/PublicInbox/Fetch.pm | 2 ++
lib/PublicInbox/Gcf2.pm | 4 ++--
lib/PublicInbox/GitHTTPBackend.pm | 13 +++++--------
lib/PublicInbox/InboxIdle.pm | 8 +++-----
lib/PublicInbox/LeiMirror.pm | 5 ++++-
lib/PublicInbox/MiscIdx.pm | 2 +-
lib/PublicInbox/OverIdx.pm | 6 +++---
lib/PublicInbox/Watch.pm | 4 ++--
script/public-inbox-watch | 6 +++---
t/extsearch.t | 6 +++---
t/git.t | 4 ++--
t/imapd.t | 6 +++---
t/import.t | 4 ++--
t/mda.t | 4 ++--
xt/git-http-backend.t | 4 ++--
17 files changed, 52 insertions(+), 54 deletions(-)
[1] grokmirror seems to sleep a bit more than it should:
https://lore.kernel.org/tools/20211013110344.GA10632@dcvr/
(And I probably have dain-bramage from insomnia :<)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-10-20 8:43 5% [PATCH 0/6] trivial clone|fetch-related stuff Eric Wong
2022-10-20 8:43 7% ` [PATCH 1/6] clone|fetch: preserve mtime of modified manifest.js.gz Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).