This commit is contained in:
Leufolium 2024-08-01 21:31:22 +08:00
parent 0bbf0f301f
commit c6fb23bfa7
1 changed files with 5 additions and 0 deletions

View File

@ -139,6 +139,7 @@ func handleScanTextResponseBodyDataElements(ctrlBlock *TextAuditTaskBatchControl
// 4.等待所有动作链元素均已抵达,判定本批次对该字段的操作是否成功
if isActionCompleted {
logger.Info("entering finalizeTask...")
if err = finalizeTask(action); err != nil {
logger.Error("finalizeTask fail: %v", err)
}
@ -170,6 +171,7 @@ func handleTextAudit(id *string, result *textaudit.ScanTextResponseBodyDataEleme
// 通过task的actionId查出action, 通知该task已完成
func handleTaskAction(task *TextAuditTaskControlBlock, actionMap map[string]*TextAuditAction) (isActionCompleted bool, action *TextAuditAction) {
logger.Info("entering handleTaskAction...")
action = actionMap[task.ActionId]
action.AuditedTaskNum++
@ -205,6 +207,8 @@ func finalizeTask(action *TextAuditAction) (err error) {
}
}
}
logger.Info("reday for handler execution...")
// 判定任务链终态,终态非成功,执行回退操作,记录到数据库中
if !action.IsPassed() {
if err = executeRollBack(lastValidTask.TextAuditTask); err != nil {
@ -221,6 +225,7 @@ func finalizeTask(action *TextAuditAction) (err error) {
}
// 终态成功,执行成功后操作
logger.Info("reday for success...")
if action.IsPassed() {
if err = handleSuccess(action.TaskChain[len(action.TaskChain)-1].TextAuditTask); err != nil {
return