by Robin at 20240101
This commit is contained in:
parent
5945014c7e
commit
a71728dc14
|
@ -45,7 +45,7 @@ func executeImageAuditTasks(tasks []*ImageAuditTaskControlBlock, batchId string)
|
|||
_result, err := defaultImageAuditClient.ScanImageAdvance(req, runtime)
|
||||
//_result, err := defaultImageAuditClient.ScanImageWithOptions(req, runtime)
|
||||
if err != nil {
|
||||
logger.Error("ScanImageAdvance fail : %v", err)
|
||||
logger.Error("ScanImageAdvance fail, requestId : %v, err : %v", _result.Body.RequestId, err)
|
||||
handleBatchError(tasks, batchId, err)
|
||||
return
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId
|
|||
|
||||
// 2.打包图像url及图像审核id,转成ScanImageAdvanceRequest
|
||||
reqTasks := make([]*imageaudit.ScanImageAdvanceRequestTask, 0)
|
||||
reqs := make([]*imageaudit.ScanImageRequestTask, 0)
|
||||
for _, task := range tasks {
|
||||
if util.DerefInt64(task.ImageAuditTask.IsFragmented) == 1 {
|
||||
imageauditIds := util.DerefStringSlice(task.ImageAuditTask.ImageAuditFragmentIds)
|
||||
|
@ -101,6 +102,10 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId
|
|||
DataId: goproto.String(imageauditIds[i]),
|
||||
ImageURLObject: file.Body,
|
||||
})
|
||||
reqs = append(reqs, &imageaudit.ScanImageRequestTask{
|
||||
DataId: goproto.String(imageauditIds[i]),
|
||||
ImageURL: goproto.String(task.Images[i].Images[0].Urls[0]),
|
||||
})
|
||||
}
|
||||
} else {
|
||||
var file *http.Response
|
||||
|
@ -113,6 +118,10 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId
|
|||
DataId: task.ImageAuditTask.ImageAuditId,
|
||||
ImageURLObject: file.Body,
|
||||
})
|
||||
reqs = append(reqs, &imageaudit.ScanImageRequestTask{
|
||||
DataId: task.ImageAuditTask.ImageAuditId,
|
||||
ImageURL: goproto.String(task.Images[0].Images[0].Urls[0]),
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -121,7 +130,7 @@ func createScanImageAdvanceRequest(tasks []*ImageAuditTaskControlBlock, batchId
|
|||
Scene: scenes,
|
||||
Task: reqTasks,
|
||||
}
|
||||
logger.Info("本次打包:%v", reqTasks)
|
||||
logger.Info("本次打包:%v", reqs)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue