编辑文件 min_heap.go
This commit is contained in:
@@ -151,14 +151,7 @@ func (m *minHeap) process() {
|
||||
// 正在运行的任务数加1
|
||||
atomic.AddInt32(&m.runCount, 1)
|
||||
go func() {
|
||||
defer func() {
|
||||
if err := recover(); err != nil { // 恢复 panic,err 为 panic 错误值
|
||||
// 1. 打印错误信息
|
||||
|
||||
fmt.Println(context.TODO(), "panic 错误:", err)
|
||||
|
||||
}
|
||||
}()
|
||||
|
||||
callback()
|
||||
// 对正在运行的任务数减1
|
||||
atomic.AddInt32(&m.runCount, -1)
|
||||
|
||||
Reference in New Issue
Block a user