From 48f586bac4e1ae634188e9e1244ba132b17c3a4a Mon Sep 17 00:00:00 2001 From: Hao Liu <44379968+TheRealHaoLiu@users.noreply.github.com> Date: Fri, 13 Oct 2023 09:48:12 -0400 Subject: [PATCH] Make wait-for-migrations wait forever (#14566) --- tools/ansible/roles/dockerfile/files/wait-for-migrations | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/ansible/roles/dockerfile/files/wait-for-migrations b/tools/ansible/roles/dockerfile/files/wait-for-migrations index 8557720591..3fcb6ab916 100755 --- a/tools/ansible/roles/dockerfile/files/wait-for-migrations +++ b/tools/ansible/roles/dockerfile/files/wait-for-migrations @@ -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})