fix: 优雅停机停等任务 goroutine,根治 TempDir 清理竞态
ci / frontend (push) Successful in 53s
ci / backend (push) Successful in 2m11s

新增 Server.Close / Engine.StopAll:取消 ctx 后依次等 side-flusher、
后台循环、各任务 planner/worker、归档 worker 退出;测试用 defer s.Close()
在清理前排空 goroutine,遂把 tempDir 兜底改回 t.TempDir() 并删除 helper。
This commit is contained in:
wangdefa committed 2026-10-20 23:08:21 -07:00
1 parent f8454d310b
commit 98515a3974
10 files changed
+75 -6

No files matched your search

+1
View File
@@ -22,6 +22,7 @@ func TestTaskCategoryBatchRoute(t *testing.T) {
td := t.TempDir()
s := New(context.Background(), m, td, td, td)
defer s.Close()
h := s.Handler()
token, err := signJWT(s.jwtKey)
if err != nil {