Add gunicorn config to "lauch_flask" in LAUCH.sh

This commit is contained in:
Alan Anselmo 2024-02-07 11:41:17 -03:00
parent b91eae630c
commit e795af6deb

View file

@ -461,12 +461,16 @@ function launch_scripts {
} }
function launch_flask { function launch_flask {
conf_dir="${AIL_HOME}/configs/"
if [[ ! $isflasked ]]; then if [[ ! $isflasked ]]; then
flask_dir=${AIL_FLASK} flask_dir=${AIL_FLASK}
screen -dmS "Flask_AIL" screen -dmS "Flask_AIL"
sleep 0.1 sleep 0.1
echo -e $GREEN"\t* Launching Flask server"$DEFAULT echo -e $GREEN"\t* Launching Flask server"$DEFAULT
screen -S "Flask_AIL" -X screen -t "Flask_server" bash -c "cd $flask_dir; ls; ${ENV_PY} ./Flask_server.py; read x" # screen -S "Flask_AIL" -X screen -t "Flask_server" bash -c "cd $flask_dir; ls; ${ENV_PY} ./Flask_server.py; read x"
screen -S "Flask_AIL" -X screen -t "Flask_server" \
bash -c "cd $flask_dir; ls; cp $conf_dir/gunicorn.conf.py .; gunicorn -c gunicorn.conf.py Flask_server:app; read x"
else else
echo -e $RED"\t* A Flask screen is already launched"$DEFAULT echo -e $RED"\t* A Flask screen is already launched"$DEFAULT
fi fi
@ -512,6 +516,10 @@ function killall {
echo -e $GREEN"Gracefully closing Kvrocks servers"$DEFAULT echo -e $GREEN"Gracefully closing Kvrocks servers"$DEFAULT
shutting_down_kvrocks; shutting_down_kvrocks;
fi fi
if [[ $isflasked ]]; then
echo -e $GREEN"Closing all gunicorn (Flask) servers"$DEFAULT
pkill gunicorn
fi
echo -e $GREEN"Killing all"$DEFAULT echo -e $GREEN"Killing all"$DEFAULT
kill $isredis $isardb $iskvrocks $islogged $is_ail_core $isscripted $isflasked $isfeeded $is_ail_2_ail kill $isredis $isardb $iskvrocks $islogged $is_ail_core $isscripted $isflasked $isfeeded $is_ail_2_ail
sleep 0.2 sleep 0.2