Commit cdf6884a authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Fix disable crons to be compatible with production server

parent 224596dc
......@@ -6,7 +6,7 @@ SCRIPTPATH=`dirname ${SCRIPT}`
DEBUG=False
LOCAL=False
PORT=5000
CRONS=True
DISABLE_CRONS=False
function usage()
{
......@@ -59,7 +59,9 @@ while [ "$1" != "" ]; do
;;
--crons)
is_bool ${VALUE} "--crons"
CRONS=${VALUE}
if [[ ${VALUE} == "False" ]]; then
DISABLE_CRONS="True"
fi
;;
*)
echo "ERROR: unknown parameter \"${PARAM}\""
......@@ -81,4 +83,4 @@ if [ "$LOCAL" == "True" ]; then
host="127.0.0.1"
fi
CRONS=${CRONS} FLASK_DEBUG=${debug} FLASK_APP=${SCRIPTPATH}/../srv/main.py flask run --host=${host} --port=${PORT}
DISABLE_CRONS=${DISABLE_CRONS} FLASK_DEBUG=${debug} FLASK_APP=${SCRIPTPATH}/../srv/main.py flask run --host=${host} --port=${PORT}
......@@ -46,7 +46,7 @@ mailer = Mailer(app)
app_data = config_reader.app_data
# Crons:
if os.getenv('CRONS') == "True":
if os.getenv('DISABLE_CRONS') != "True":
print("Starting crons...")
crons = Crons(app_folder)
crons.start_all()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment