SSE Patch 增量推送架构全链路实现
- web/sse_manager.py: asyncio.Queue 连接池 + broadcast + event_stream - web/routers/sse_router.py: GET /api/events + POST /api/internal/collector-patch - weather_sources.py: 采集后 POST patch 给 web - Nginx polyweather.conf: /api/events proxy_buffering off - frontend/api/events/route.ts: Next.js SSE 代理 - frontend/hooks/use-sse-patches.ts: EventSource + useLatestPatch + 重连 - LiveTemperatureThresholdChart: mergePatchIntoHourly 增量合并 - scan-terminal-query: 接入 SSE patch 更新行数据 - 新增 ssePatchArchitecture.test.ts 架构测试
This commit is contained in:
@@ -18,7 +18,7 @@ export type RemoteData<T> =
|
||||
| { status: "error"; error: string; previous?: T };
|
||||
|
||||
export const scanTerminalQueryPolicy = {
|
||||
autoRefreshMs: DASHBOARD_REFRESH_POLICY_MS.scanRows,
|
||||
autoRefreshMs: null,
|
||||
manualForceRefreshCooldownMs: 2 * 60_000,
|
||||
} as const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user