From 506b6a3e22906dbac3cfb0f65cfa1d48f7c78849 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 23 Mar 2020 16:18:58 +0100 Subject: [PATCH] s3-mirror: try to set 'max-age' cache opt for repomd.xml files --- roles/s3-mirror/files/s3.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/s3-mirror/files/s3.sh b/roles/s3-mirror/files/s3.sh index 70046d21f4..c157b0cdb9 100644 --- a/roles/s3-mirror/files/s3.sh +++ b/roles/s3-mirror/files/s3.sh @@ -93,8 +93,9 @@ excludes=( CMD1=( "${aws_sync[@]}" "${excludes[@]}" --exclude "*/repomd.xml" ) # Next we run this command which syncs repomd.xml files. Include must precede -# the large set of excludes. -CMD2=( "${aws_sync[@]}" --exclude "*" --include "*/repomd.xml" "${excludes[@]}" ) +# the large set of excludes. Make sure that the 'max-age' isn't too large so +# we know that we can start removing old data ASAP. +CMD2=( "${aws_sync[@]}" --exclude "*" --include "*/repomd.xml" "${excludes[@]}" --cache-control max-age=300 ) # Then we delete old RPMs and old metadata (but after invalidating caches). CMD3=( "${aws_sync[@]}" "${excludes[@]}" --delete )