mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 14:34:21 +01:00
Fix MySQL availability tries counter (#150)
The variable `i` was not declared and never incremented.
This commit is contained in:
committed by
Kevin Chung
parent
2115e9c005
commit
07bfe5eab7
@@ -3,13 +3,15 @@
|
|||||||
sed "s;sqlite:///ctfd.db;mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db/ctfd;g" CTFd/config.py -i
|
sed "s;sqlite:///ctfd.db;mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db/ctfd;g" CTFd/config.py -i
|
||||||
|
|
||||||
# wait for mysql to start
|
# wait for mysql to start
|
||||||
|
cnt=0
|
||||||
while ! nc db 3306 >/dev/null 2>&1 < /dev/null; do
|
while ! nc db 3306 >/dev/null 2>&1 < /dev/null; do
|
||||||
if [ $i -ge 50 ]; then
|
if [ $cnt -ge 50 ]; then
|
||||||
echo "$(date) - db:3306 still not reachable, giving up"
|
echo "$(date) - db:3306 still not reachable, giving up"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "$(date) - waiting for db:3306..."
|
echo "$(date) - waiting for db:3306..."
|
||||||
sleep 1
|
sleep 1
|
||||||
|
cnt=`expr $cnt + 1`
|
||||||
done
|
done
|
||||||
|
|
||||||
gunicorn --bind 0.0.0.0:8000 -w 4 "CTFd:create_app()"
|
gunicorn --bind 0.0.0.0:8000 -w 4 "CTFd:create_app()"
|
||||||
|
|||||||
Reference in New Issue
Block a user