编辑文件 min_heap.go

This commit is contained in:
xinian
2026-01-29 02:12:21 +08:00
committed by cnb
parent 2744f72eb2
commit ee9c256286

View File

@@ -151,14 +151,7 @@ func (m *minHeap) process() {
// 正在运行的任务数加1
atomic.AddInt32(&m.runCount, 1)
go func() {
defer func() {
if err := recover(); err != nil { // 恢复 panicerr 为 panic 错误值
// 1. 打印错误信息
fmt.Println(context.TODO(), "panic 错误:", err)
}
}()
callback()
// 对正在运行的任务数减1
atomic.AddInt32(&m.runCount, -1)