Bust the CDN cache when reading published channel dbs

pkgs.omarchy.org sits behind Cloudflare, and right after a sync the
plain db URL keeps serving the previous file from the edge cache
(observed: a cache HIT with age 900s+ returning the pre-release db).
That made status report the old version, wait_for_published poll a
frozen file for its full timeout, and would let RC auto-numbering
count from last release's versions. A unique query string per fetch
skips the cached entry.
This commit is contained in:
Ryan Hughes
2026-08-30 13:35:44 -04:00
parent bde81c757c
commit 82b28bb6f3
2 changed files with 9 additions and 2 deletions
+5 -1
View File
@@ -102,7 +102,11 @@ pkgbuild_var() {
published_edge_version() { published_edge_version() {
local pkg="$1" tmp descs local pkg="$1" tmp descs
tmp=$(mktemp) || return 2 tmp=$(mktemp) || return 2
if ! curl -sf "$EDGE_DB_URL" -o "$tmp"; then # Bust the CDN cache — a stale db here mis-numbers the next rcN or lets an
# ordering check run against last release's versions.
local sep='?'
[[ "$EDGE_DB_URL" == *\?* ]] && sep='&'
if ! curl -sf "$EDGE_DB_URL$sep$(date +%s%N)" -o "$tmp"; then
rm -f "$tmp" rm -f "$tmp"
return 2 return 2
fi fi
+4 -1
View File
@@ -176,7 +176,10 @@ ensure_work_clone() {
published_version() { published_version() {
local channel="$1" tmp descs local channel="$1" tmp descs
tmp=$(mktemp) || return 2 tmp=$(mktemp) || return 2
if ! curl -sf "$PKGS_DB_BASE/$channel/x86_64/omarchy.db.tar.zst" -o "$tmp"; then # A unique query string busts the CDN cache: right after a sync the plain
# URL can keep serving the previous db for a while, which reads as "not
# published yet" to status, the wait loop, and ship's pre-checks.
if ! curl -sf "$PKGS_DB_BASE/$channel/x86_64/omarchy.db.tar.zst?$(date +%s%N)" -o "$tmp"; then
rm -f "$tmp" rm -f "$tmp"
return 2 return 2
fi fi