Skip to content

Commit

Permalink
fixup! fix: wait for agd to stop if it's running
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Mar 13, 2024
1 parent f6b824c commit 9f47b9e
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions packages/synthetic-chain/public/upgrade-test-scripts/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,17 @@ await_agd_startable() {

local wait="10s"

agd status >/dev/null 2>&1
local exit_code=$?

# If agd is running and we have not reached the maximum number of retries,
# wait and try again
if [[ $exit_code -eq 0 && $retries -gt 0 ]]; then
echo "Waiting $wait for agd to stop"
sleep $wait

wait_and_retry $(($retries - 1))
else
echo "Cannot start agd because it's already running"
return $exit_code
if agd status >/dev/null 2>&1; then
# agd is running
if [[ $retries -gt 0 ]]; then
echo "Waiting $wait for agd to stop"
sleep $wait

wait_and_retry $(($retries - 1))
else
echo "Cannot start agd because it's already running"
return 1
fi
fi
}

Expand Down

0 comments on commit 9f47b9e

Please sign in to comment.