fix: pool wg negative count

This commit is contained in:
M09Ic committed 2026-01-19 18:02:18 +08:00
1 parent 6618e025c3
commit a3d7d1eccb
1 file changed
+8 -10
+8 -10
View File
@@ -48,17 +48,15 @@ func (pool *BasePool) addAddition(u *Unit) {
select {
case pool.additionCh <- u:
default:
// 强行屏蔽报错, 防止goroutine泄露
go func() {
select {
case pool.additionCh <- u:
case <-pool.ctx.Done():
pool.wg.Done()
}
}()
}
pool.wg.Add(1)
// 强行屏蔽报错, 防止goroutine泄露
go func() {
select {
case pool.additionCh <- u:
pool.wg.Done()
case <-pool.ctx.Done():
pool.wg.Done()
}
}()
}
func (pool *BasePool) putToOutput(bl *baseline.Baseline) {