Skip to content

skip mysql endpoint check if DB_HOST is empty #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions root/etc/cont-init.d/50-config
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ fi

# check for the mysql endpoint for 30 seconds
END=$((SECONDS+30))
while [ ${SECONDS} -lt ${END} ]; do
while [ ${SECONDS} -lt ${END} ] && [ "${DB_HOST}" ];
do
/usr/bin/nc -z ${DB_HOST} 3306 && \
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ]; then
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} 3306)" ];
then
[ ! -z "${RUN}" ] && break
RUN="RAN"
# we sleep here again due to first run init on DB containers
Expand Down