Modify DB initialization completion judgment flag 23/102823/1 1.3.7
authoryangyan <yangyanyj@chinamobile.com>
Tue, 3 Mar 2020 07:41:04 +0000 (15:41 +0800)
committeryangyan <yangyanyj@chinamobile.com>
Tue, 3 Mar 2020 07:41:19 +0000 (15:41 +0800)
Change-Id: Ia91f2cb283504c28e6bc0208b2e91ea444b455a1
Issue-ID: VFC-1639
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
res/docker/docker-entrypoint.sh

index 60abc80..0f85abd 100755 (executable)
@@ -31,8 +31,8 @@ done
 # Wait for DB initialization
 echo "Wait for DB initialization"
 for i in {1..5}; do
-    curl -sS -m 1 $MYSQL_ADDR > /dev/null && break
-    sleep $i
+    mysql -u$MYSQL_ROOT_USER -p$MYSQL_ROOT_PASSWORD -h`echo $MYSQL_ADDR | cut -d: -f 1` -P`echo $MYSQL_ADDR | cut -d: -f 2` -e "show databases;" > /dev/null && echo "DB initialization completed" && break
+    sleep $i && echo "`echo $MYSQL_ADDR | cut -d: -f 1` connection failed"
 done
 
 # Configure service based on docker environment variables