Make wait-for-migrations wait forever (#14566)

This commit is contained in:
Hao Liu 2023-10-13 09:48:12 -04:00 committed by GitHub
parent 16dab57c63
commit 48f586bac4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,6 @@ readonly CMDNAME=$(basename "$0")
readonly MIN_SLEEP=0.5
readonly MAX_SLEEP=30
readonly ATTEMPTS=30
readonly TIMEOUT=60
log_message() { echo "[${CMDNAME}]" "$@" >&2; }
@ -25,7 +24,7 @@ wait_for() {
local check=1
while true; do
log_message "Attempt ${attempt} of ${ATTEMPTS}"
log_message "Attempt ${attempt}"
timeout "${TIMEOUT}" \
/bin/bash -c "awx-manage check" &>/dev/null
@ -37,8 +36,7 @@ wait_for() {
&& return || rc=$?
fi
(( ++attempt > ATTEMPTS )) && break
attempt=$((attempt + 1))
log_message "Waiting ${next_sleep} seconds before next attempt"
sleep "${next_sleep}"
next_sleep=$(next_sleep ${next_sleep})