File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,8 +34,13 @@ wait_for_ready() {
3434 bash " ${script_dir} /wait_for_ib_gateway_ready.sh" " ${gateway_mode} "
3535}
3636
37+ ensure_2fa_bot_running () {
38+ CONTAINER_NAME=" ${container_name} " bash " ${script_dir} /ensure_2fa_bot_running.sh"
39+ }
40+
3741echo " Ensuring ${container_name} is running before readiness check."
3842docker compose up -d --no-build
43+ ensure_2fa_bot_running
3944
4045if wait_for_ready " ${initial_wait_seconds} " ; then
4146 exit 0
4449echo " IB gateway API was not ready; restarting ${container_name} and retrying." >&2
4550docker compose ps >&2 || true
4651docker compose restart " ${container_name} "
52+ ensure_2fa_bot_running
4753
4854if wait_for_ready " ${restart_wait_seconds} " ; then
4955 exit 0
5056fi
5157
5258echo " IB gateway API is still not ready; recreating ${container_name} and retrying." >&2
5359docker compose up -d --force-recreate --no-build " ${container_name} "
60+ ensure_2fa_bot_running
5461
5562if wait_for_ready " ${recreate_wait_seconds} " ; then
5663 exit 0
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ grep -Fq 'flock -w "${lock_wait_seconds}" 9' "$recover_script"
2626grep -Fq ' docker compose restart "${container_name}"' " $recover_script "
2727grep -Fq ' docker compose up -d --force-recreate --no-build "${container_name}"' " $recover_script "
2828grep -Fq ' IB_GATEWAY_READY_TIMEOUT_SECONDS="${timeout_seconds}"' " $recover_script "
29+ grep -Fq ' CONTAINER_NAME="${container_name}" bash "${script_dir}/ensure_2fa_bot_running.sh"' " $recover_script "
30+ ensure_count=" $( grep -c ' ensure_2fa_bot_running' " $recover_script " ) "
31+ test " $ensure_count " -ge 4
2932
3033grep -Fq ' swap_size_mib="${IB_GATEWAY_SWAP_SIZE_MIB:-2048}"' " $swap_script "
3134grep -Fq ' fallocate -l "${swap_size_mib}M" "${swap_file}"' " $swap_script "
You can’t perform that action at this time.
0 commit comments