fix(bot): 防递归重连 guard - 防止 on_disconnect → reconnect → disconnect 无限递归导致栈溢出

This commit is contained in:
知微
2026-07-19 20:59:18 +08:00
parent 81c6dd2314
commit e366a6359a
43 changed files with 7668 additions and 1988 deletions
+86
View File
@@ -0,0 +1,86 @@
# MoFin — 快速操作手册
> 生产环境: Linux 192.168.1.246 | 端口: API 8899 / Dashboard 5804
---
## 日常检查
```bash
# 打开 Dashboard 看全局
http://192.168.1.246:5805
# 命令行快速状态
ssh hmo@192.168.1.246 "curl -s http://127.0.0.1:5805/api/services | python3 -m json.tool | head -20"
```
---
## Dashboard
```bash
# 查看状态
ssh hmo@192.168.1.246 "sudo systemctl status mofin-dashboard"
# 重启
ssh hmo@192.168.1.246 "sudo systemctl restart mofin-dashboard"
# 查看日志
ssh hmo@192.168.1.246 "tail -50 ~/MoFin/gateway/logs/dashboard.log"
```
---
## MoFin API
```bash
# 查看状态
ssh hmo@192.168.1.246 "sudo systemctl status mofin-api"
# 重启
ssh hmo@192.168.1.246 "sudo systemctl restart mofin-api"
# 测试 API
curl http://192.168.1.246:8899/api/portfolio
```
---
## 健康检查
```bash
# 查看定时任务
ssh hmo@192.168.1.246 "crontab -l | grep health"
# 手动运行(无输出 = 全正常)
ssh hmo@192.168.1.246 "cd ~/MoFin && python3 agents_health_check.py"
# 查看最近报告
ssh hmo@192.168.1.246 "cat ~/MoFin/gateway/temp/last_health_check.json | python3 -m json.tool"
```
---
## 部署更新
```bash
# 1. 拉代码
ssh hmo@192.168.1.246 "cd ~/MoFin && git pull --rebase"
# 2. 重启受影响的服务
ssh hmo@192.168.1.246 "sudo systemctl restart mofin-dashboard"
# 3. 验证
ssh hmo@192.168.1.246 "curl -s http://127.0.0.1:5805/api/health"
```
---
## 常见问题
| 现象 | 操作 |
|------|------|
| Dashboard 不响应 | `ssh hmo@246 sudo systemctl restart mofin-dashboard` |
| F Tab 定时任务显示"未部署" | `ssh hmo@246 crontab -l \| grep health` 确认 |
| MoFin API 不响应 | `ssh hmo@246 sudo systemctl restart mofin-api` |
| 数据库查询失败 | `ssh hmo@246 'ls -la /home/hmo/web-dashboard/data/mofin.db'` |