Skip to content

Commit

Permalink
Fix purging of multiple surrogate keys
Browse files Browse the repository at this point in the history
Closes #206.
  • Loading branch information
ericmj committed Feb 13, 2025
1 parent a43b1ea commit 9e69d2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions priv/scripts/elixir/elixir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function push {
upload_build "$1" ""
update_builds_txt "$1" "$2" ""

fastly_purge $BOB_FASTLY_SERVICE_HEXPM builds/elixir/txt
fastly_purge $BOB_FASTLY_SERVICE_BUILDS builds/elixir/txt

PATH=${original_path}
Expand Down Expand Up @@ -85,7 +84,6 @@ function upload_build {
upload_build master "${2}"
fi

fastly_purge $BOB_FASTLY_SERVICE_HEXPM "builds/elixir/${version}${2}"
fastly_purge $BOB_FASTLY_SERVICE_BUILDS "builds/elixir/${version}${2}"
}

Expand Down
1 change: 0 additions & 1 deletion priv/scripts/otp/otp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ echo -e "${ref_name} ${ref} $(date -u '+%Y-%m-%dT%H:%M:%SZ') ${build_sha256}\n$(
sort -u -k1,1 -o builds.txt builds.txt
aws s3 cp builds.txt s3://s3.hex.pm/builds/otp/${arch}/${linux}/builds.txt --cache-control "public,max-age=3600" --metadata "{\"surrogate-key\":\"builds builds/otp builds/otp/${arch} builds/otp/${arch}/${linux} builds/otp/${arch}/${linux}/txt\",\"surrogate-control\":\"public,max-age=604800\"}"

fastly_purge $BOB_FASTLY_SERVICE_HEXPM "builds/otp/${arch}/${linux}/txt builds/otp/${arch}/${linux}/${ref_name}"
fastly_purge $BOB_FASTLY_SERVICE_BUILDS "builds/otp/${arch}/${linux}/txt builds/otp/${arch}/${linux}/${ref_name}"
6 changes: 3 additions & 3 deletions priv/scripts/utils.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# $1 = service
# $2 = keys
function fastly_purge {
fastly_purge_request $1 $2
fastly_purge_request $1 "$2"
sleep 4
fastly_purge_request $1 $2
fastly_purge_request $1 "$2"
sleep 4
fastly_purge_request $1 $2
fastly_purge_request $1 "$2"
}

# $1 = service
Expand Down

0 comments on commit 9e69d2b

Please sign in to comment.