| @@ -1,6 +1,7 @@ | |||||
| package jcs | package jcs | ||||
| import ( | import ( | ||||
| "github.com/zeromicro/go-zero/core/logx" | |||||
| "gitlink.org.cn/JointCloud/pcm-openi/common" | "gitlink.org.cn/JointCloud/pcm-openi/common" | ||||
| ) | ) | ||||
| @@ -24,15 +25,19 @@ func StatusReport(url string, report *JobStatusReportReq) error { | |||||
| }{} | }{} | ||||
| req := common.GetRestyRequest(common.TIMEOUT) | req := common.GetRestyRequest(common.TIMEOUT) | ||||
| _, err := req. | |||||
| rp, err := req. | |||||
| SetHeader("Content-Type", "application/json"). | SetHeader("Content-Type", "application/json"). | ||||
| SetBody(report). | SetBody(report). | ||||
| SetResult(&resp). | SetResult(&resp). | ||||
| Post(url) | Post(url) | ||||
| if err != nil { | if err != nil { | ||||
| logx.Errorf("############ Report Status Message Error %s", err.Error()) | |||||
| return err | return err | ||||
| } | } | ||||
| logx.Errorf("############ Report Status Message After Sending %s", string(rp.Body())) | |||||
| return nil | return nil | ||||
| } | } | ||||
| @@ -66,9 +66,13 @@ func UpdateTaskStatus(svc *svc.ServiceContext, tasklist []*types.TaskModel) { | |||||
| switch aiTask[0].Status { | switch aiTask[0].Status { | ||||
| case constants.Completed: | case constants.Completed: | ||||
| task.Status = constants.Succeeded | task.Status = constants.Succeeded | ||||
| logx.Errorf("############ Report Status Message Before Sending %s", task.Status) | |||||
| _ = reportStatusMessages(svc, task, aiTask[0]) | _ = reportStatusMessages(svc, task, aiTask[0]) | ||||
| case constants.Failed: | case constants.Failed: | ||||
| task.Status = constants.Failed | task.Status = constants.Failed | ||||
| logx.Errorf("############ Report Status Message Before Sending %s", task.Status) | |||||
| _ = reportStatusMessages(svc, task, aiTask[0]) | _ = reportStatusMessages(svc, task, aiTask[0]) | ||||
| default: | default: | ||||
| task.Status = aiTask[0].Status | task.Status = aiTask[0].Status | ||||