forked from HysunHe/text2sql_selectai_rag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·50 lines (37 loc) · 1.2 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Description:
# - AiReport project. This is a demo POC project, it is not intented
# for production. The quality of the code is not guaranteed.
#
# If you refrence the code in this project, it means that you understand
# the risk and you are responsible for any issues caused by the code.
#
# History:
# - 2025/01/20 by Hysun ([email protected]): Initial implementation.
kill -9 `lsof -i:8080 | awk '{print $2}' | grep -v "PID"` > /dev/null 2>&1
echo -n "Starting service ."
source `conda info --base`/etc/profile.d/conda.sh
conda activate base
nohup python main.py > /dev/null 2>&1 &
arg1=$1
log_file=$LOG_FILE_PATH
if [[ -z $log_file ]]
then
log_file=`grep "LOG_FILE_PATH" app.env | sed "s/LOG_FILE_PATH=//"`
fi
if [[ $arg1 != "nowait" ]]
then
while true
do
result=`tail $log_file`
if [[ $result == *"WSGI server listening at"* ]]; then
echo 'Service started.'
break
else
echo -n '.'
sleep 1
fi
done
fi
cd - > /dev/null
echo "--------------"
echo "To view logs, run the command [ tail -300f $log_file ]"