chore: initial commit
This commit is contained in:
15
run_bot_loop.sh
Executable file
15
run_bot_loop.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
LOG_FILE="bot_agent_sdk.log"
|
||||
mkdir -p logs
|
||||
LOG_PATH="$(pwd)/$LOG_FILE"
|
||||
|
||||
while true; do
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ▶️ 启动客服机器人" | tee -a "$LOG_PATH"
|
||||
python3 -u integrated_bot_ai.py 2>&1 | tee -a "$LOG_PATH"
|
||||
exit_code=${PIPESTATUS[0]}
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] ⚠️ 机器人退出,状态码 $exit_code,5 秒后重启" | tee -a "$LOG_PATH"
|
||||
sleep 5
|
||||
done
|
||||
Reference in New Issue
Block a user