fix(lifecycle): prevent eager date-expiry deletion on config update (#2708)

This commit is contained in:
houseme
2026-04-28 18:26:14 +08:00
committed by GitHub
parent e0b8c4fd42
commit 2953558f41
28 changed files with 3069 additions and 593 deletions
+28 -5
View File
@@ -74,6 +74,16 @@ require_cmd() {
fi
}
normalize_warp_host() {
local raw="$1"
raw="${raw#http://}"
raw="${raw#https://}"
raw="${raw%%/*}"
raw="${raw%%\?*}"
raw="${raw%%\#*}"
echo "$raw"
}
parse_args() {
while [[ $# -gt 0 ]]; do
case "$1" in
@@ -127,6 +137,14 @@ validate_args() {
exit 1
fi
fi
if [[ "$TOOL" == "warp" ]]; then
local warp_host
warp_host="$(normalize_warp_host "$ENDPOINT")"
if [[ -z "$warp_host" ]]; then
echo "ERROR: invalid --endpoint for warp: $ENDPOINT" >&2
exit 1
fi
fi
}
setup_output() {
@@ -141,7 +159,7 @@ setup_output() {
extract_value() {
local pattern="$1"
local file="$2"
rg -o "$pattern" "$file" | head -n1 | sed -E "s/$pattern/\\1/" || true
rg -o "$pattern" "$file" | head -n1 || true
}
collect_metrics() {
@@ -161,9 +179,11 @@ run_one() {
echo "==== [$TOOL] size=$size concurrency=$CONCURRENCY ===="
if [[ "$TOOL" == "warp" ]]; then
local warp_host
warp_host="$(normalize_warp_host "$ENDPOINT")"
local cmd=(
"$WARP_BIN" "$WARP_MODE"
"--host" "$ENDPOINT"
"--host" "$warp_host"
"--access-key" "$ACCESS_KEY"
"--secret-key" "$SECRET_KEY"
"--bucket" "$BUCKET"
@@ -175,7 +195,9 @@ run_one() {
if [[ "$INSECURE" == "true" ]]; then
cmd+=("--insecure")
fi
cmd+=("${EXTRA_ARGS[@]}")
if [[ ${EXTRA_ARGS[@]+_} ]]; then
cmd+=("${EXTRA_ARGS[@]}")
fi
if [[ "$DRY_RUN" == "true" ]]; then
printf '[DRY-RUN] %q ' "${cmd[@]}"
@@ -201,7 +223,9 @@ run_one() {
if [[ "$INSECURE" == "true" ]]; then
cmd+=("-insecure")
fi
cmd+=("${EXTRA_ARGS[@]}")
if [[ ${EXTRA_ARGS[@]+_} ]]; then
cmd+=("${EXTRA_ARGS[@]}")
fi
if [[ "$DRY_RUN" == "true" ]]; then
printf '[DRY-RUN] %q ' "${cmd[@]}"
@@ -255,4 +279,3 @@ main() {
}
main "$@"