同步错误返回修改
This commit is contained in:
@@ -651,17 +651,16 @@ func buildSetFinishHook(task tasksch.ITask, ctx *jxcontext.Context) {
|
|||||||
if len(task.GetFailedList()) > 10 {
|
if len(task.GetFailedList()) > 10 {
|
||||||
downloadURL, _, _ := WirteToExcelBySyncFailed(task)
|
downloadURL, _, _ := WirteToExcelBySyncFailed(task)
|
||||||
noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL)
|
noticeMsg += fmt.Sprintf("[详情点我]%s/billshow/?normal=true&path=%s \n", globals.BackstageHost, downloadURL)
|
||||||
if authInfo, err := ctx.GetV2AuthInfo(); err == nil {
|
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg)
|
|
||||||
}
|
|
||||||
} else if len(task.GetFailedList()) > 0 && len(task.GetFailedList()) <= 10 {
|
} else if len(task.GetFailedList()) > 0 && len(task.GetFailedList()) <= 10 {
|
||||||
if task.GetErr() != nil {
|
if task.GetErr() != nil {
|
||||||
noticeMsg += utils.Format4Output(buildErrMsgJson(task), true)
|
noticeMsg += utils.Format4Output(buildErrMsgJson(task), true)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
noticeMsg = "您的同步任务执行完成,没有错误返回。"
|
||||||
|
}
|
||||||
if authInfo, err := ctx.GetV2AuthInfo(); err == nil {
|
if authInfo, err := ctx.GetV2AuthInfo(); err == nil {
|
||||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg)
|
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, authInfo.UserID, "同步错误返回", noticeMsg)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if time.Now().Hour() >= 20 || time.Now().Hour() < 7 {
|
if time.Now().Hour() >= 20 || time.Now().Hour() < 7 {
|
||||||
downloadURL, _, _ := WirteToExcelBySyncFailed(task)
|
downloadURL, _, _ := WirteToExcelBySyncFailed(task)
|
||||||
|
|||||||
@@ -475,7 +475,6 @@ func (t *BaseTask) run(taskHandler func()) {
|
|||||||
close(t.finishChan)
|
close(t.finishChan)
|
||||||
if t.finishHook != nil {
|
if t.finishHook != nil {
|
||||||
t.finishHook(t)
|
t.finishHook(t)
|
||||||
SendMessage(t)
|
|
||||||
} else {
|
} else {
|
||||||
SendMessage(t)
|
SendMessage(t)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user