File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 5858 fi
5959 }
6060
61+ wait_for_service() {
62+ local url=$1
63+ local max_retries=30
64+ local retry_count=0
65+ local response
66+
67+ until [ $retry_count -ge $max_retries ]
68+ do
69+ response=$(curl -s -o /dev/null -w "%{http_code}" $url)
70+ if [ "$response" -eq 200 ]; then
71+ echo "Service at $url is up"
72+ return 0
73+ fi
74+ retry_count=$((retry_count+1))
75+ echo "Waiting for service at $url to be up... ($retry_count/$max_retries)"
76+ sleep 10
77+ done
78+
79+ echo "Service at $url failed to start"
80+ exit 1
81+ }
82+
83+ # Wait all Service
84+ wait_for_service http://127.0.0.1:10008/account/register
85+ wait_for_service http://127.0.0.1:10002/auth/get_admin_token
86+
87+
6188 # Test register
6289 response1=$(curl -X POST -H "Content-Type: application/json" -H "operationID: imAdmin" -d '{
6390 "verifyCode": "666666",
You can’t perform that action at this time.
0 commit comments