From e795af6debbf0ae4ab82cf3263170f952ad7aaa5 Mon Sep 17 00:00:00 2001 From: Alan Anselmo Date: Wed, 7 Feb 2024 11:41:17 -0300 Subject: [PATCH] Add gunicorn config to "lauch_flask" in LAUCH.sh --- bin/LAUNCH.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/LAUNCH.sh b/bin/LAUNCH.sh index 547cd76f..c5af61e9 100755 --- a/bin/LAUNCH.sh +++ b/bin/LAUNCH.sh @@ -461,12 +461,16 @@ function launch_scripts { } function launch_flask { + conf_dir="${AIL_HOME}/configs/" + if [[ ! $isflasked ]]; then flask_dir=${AIL_FLASK} screen -dmS "Flask_AIL" sleep 0.1 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 echo -e $RED"\t* A Flask screen is already launched"$DEFAULT fi @@ -512,6 +516,10 @@ function killall { echo -e $GREEN"Gracefully closing Kvrocks servers"$DEFAULT shutting_down_kvrocks; fi + if [[ $isflasked ]]; then + echo -e $GREEN"Closing all gunicorn (Flask) servers"$DEFAULT + pkill gunicorn + fi echo -e $GREEN"Killing all"$DEFAULT kill $isredis $isardb $iskvrocks $islogged $is_ail_core $isscripted $isflasked $isfeeded $is_ail_2_ail sleep 0.2