同步错误返回
This commit is contained in:
@@ -66,6 +66,7 @@ type ITask interface {
|
||||
AddErrMsg(failedList ...interface{})
|
||||
GetErrMsg() (failedList []interface{})
|
||||
SetFinishHook(func(task ITask))
|
||||
GetFinishHook() func(task ITask)
|
||||
json.Marshaler
|
||||
}
|
||||
|
||||
@@ -229,6 +230,10 @@ func (t *BaseTask) GetTotalJobCount() int {
|
||||
return t.TotalJobCount
|
||||
}
|
||||
|
||||
func (t *BaseTask) GetFinishHook() func(ITask) {
|
||||
return t.FinishHook
|
||||
}
|
||||
|
||||
func (t *BaseTask) GetFinishedJobCount() int {
|
||||
t.locker.RLock()
|
||||
defer t.locker.RUnlock()
|
||||
@@ -474,7 +479,7 @@ func (t *BaseTask) run(taskHandler func()) {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "异步任务完成", content)
|
||||
}
|
||||
}
|
||||
t.SetFinishHook(t.FinishHook)
|
||||
t.GetFinishHook()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user