by Robin at 20240207;

This commit is contained in:
Leufolium 2024-02-07 15:15:57 +08:00
parent d195f05661
commit 1f44a063f7
2 changed files with 2 additions and 2 deletions

View File

@ -24,6 +24,7 @@ func AddTasks(tasks []*dbstruct.ImageAuditTask) error {
func AddTask(task *dbstruct.ImageAuditTask) error {
// 若非对齐任务,则进行插入前预处理
task.BatchId = goproto.String(defaultImageAuditTaskScheduler.batchId)
if !task.IsForAlignment() {
if task == nil || task.AuditedMedia == nil {
return nil
@ -33,7 +34,6 @@ func AddTask(task *dbstruct.ImageAuditTask) error {
return nil
}
task.BatchId = goproto.String(defaultImageAuditTaskScheduler.batchId)
task.Status = goproto.Int64(consts.ImageAudit_Created)
if fragmentNum == 1 {

View File

@ -23,12 +23,12 @@ func AddTasks(tasks []*dbstruct.TextAuditTask) error {
func AddTask(task *dbstruct.TextAuditTask) error {
// 若非对齐任务,则进行插入前预处理
task.BatchId = goproto.String(defaultTextAuditTaskScheduler.batchId)
if !task.IsForAlignment() {
if task == nil || task.AuditedText == nil {
return nil
}
task.BatchId = goproto.String(defaultTextAuditTaskScheduler.batchId)
task.Status = goproto.Int64(consts.TextAudit_Created)
// 1.写入文字审核表