Add SSE second-level dashboard stream and 2s client heartbeat.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-17 21:04:55 +08:00
parent ba74a9cce8
commit d860156b11
8 changed files with 114 additions and 62 deletions
+4 -2
View File
@@ -3,11 +3,13 @@
## 1. 架构
```
Browser (复盘/管理) ──HTTP:5800──► Flask(gunicorn) + SQLite
Browser (复盘大屏) ──SSE/HTTP:5800──► Flask(gunicorn threads) + SQLite
▲
Windows exe (通用包+激活) ──API───────────┘
Windows exe (心跳约2s + 成交上报) ───────┘
│
└── MetaTrader5 (本机)
总览秒级:`GET /api/dashboard/stream`(SSE,约 1 秒一帧);在线判定约 8 秒无心跳为离线。
```
- **不直连数据库**:多机只走 HTTP API。