huanghaosheng
101f46f927
feat(api): 接进程 ctx 并停止启动异步链路
API 只装配 HTTP 入口。SetRouter 增加 ctx,删除 Outbox 轮询、Timeline 消费者与三个通知消费者的启动,改调 StartNotificationSubscriber。
SSEHub 记录进程 ctx。ctx 结束时 SSEHandler 主动断开。Shutdown 只关空闲连接、不取消在途请求,而 SSE 响应永不结束。少了这条路径,每次停机都要耗满 10 秒超时。
cmd/main 改用 signal.NotifyContext 与 http.Server。ListenAndServe 放进 goroutine,主协程等信号或启动失败,再以 10 秒上界 Shutdown,超时才 Close 兜底。
router_test 适配新签名,并新增用例守住四条通知路由仍注册。
2026-11-08 14:44:32 +08:00
..
2026-11-01 15:15:15 +08:00
2026-11-01 15:15:15 +08:00
2026-11-01 16:47:31 +08:00
2026-10-30 13:14:03 +08:00
2026-10-31 10:08:03 +08:00
2026-11-01 15:15:15 +08:00
2026-11-01 16:47:31 +08:00
2026-11-08 14:44:29 +08:00
2026-11-08 14:44:29 +08:00
2026-10-30 23:48:43 +08:00
2026-10-30 15:20:15 +08:00
2026-10-31 00:03:53 +08:00
2026-10-28 21:54:35 +08:00
2026-10-30 15:20:15 +08:00
2026-11-08 14:44:32 +08:00