auto_trade_sys/backend/stop_recommendations.sh
薇薇安 5f256daf27 feat(recommendations): 添加推荐服务管理API与前端控制功能
在后端API中新增推荐服务的状态检查、重启、停止和启动功能,确保能够有效管理推荐服务进程。同时,更新前端组件以支持推荐服务状态的显示与控制,提升用户体验。此改动为推荐服务的管理提供了更直观的操作界面与实时状态反馈。
2026-02-23 18:02:53 +08:00

22 lines
563 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 停止推荐服务recommendations_main
cd "$(dirname "$0")"
# 查找 recommendations_main 进程
PID=$(ps aux | grep "trading_system.recommendations_main" | grep -v grep | awk '{print $2}')
if [ -z "$PID" ]; then
echo "未找到运行中的推荐服务"
else
echo "找到推荐服务PID: $PID"
echo "正在停止..."
kill $PID 2>/dev/null || true
sleep 2
if ps -p $PID > /dev/null 2>&1; then
echo "尝试强制停止..."
kill -9 $PID 2>/dev/null || true
fi
echo "推荐服务已停止"
fi