aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-11-14 23:38:29 +0000
committerrubenwardy <rw@rubenwardy.com>2019-11-14 23:38:29 +0000
commit719a652235126fd972e41e62f6f519aec5b75bdc (patch)
tree49701bcb4adb03745490e894c24f63d3b8a266d0
parent50892ce9fc6a44475b447b90909f83c2148f8096 (diff)
downloadcheatdb-719a652235126fd972e41e62f6f519aec5b75bdc.tar.xz
Enable hot code reloading
-rwxr-xr-xutils/run.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils/run.sh b/utils/run.sh
index 3d19d84..dee2a54 100755
--- a/utils/run.sh
+++ b/utils/run.sh
@@ -8,4 +8,14 @@ if [ -z "$FLASK_DEBUG" ]; then
exit 1
fi
-gunicorn -w 4 -b :5123 -e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG app:app
+ENV="-e FLASK_APP=app/__init__.py -e FLASK_CONFIG=../config.cfg -e FLASK_DEBUG=$FLASK_DEBUG"
+
+if [ "$FLASK_DEBUG" -eq "1" ]; then
+ EXTRA="--reload"
+fi
+
+echo "Running gunicorn with:"
+echo " - env: $ENV"
+echo " - extra: $EXTRA"
+
+gunicorn -w 4 -b :5123 $ENV $EXTRA app:app