redis队列替换kafka

Former-commit-id: 744a11a0d88e451f77fd3ea525f219e968bba701
This commit is contained in:
zhangwei 2023-10-16 10:27:49 +08:00
parent f66c9b8b7b
commit bdb1ad3d59
2 changed files with 8 additions and 9 deletions

View File

@ -341,7 +341,7 @@ type ImportTasks {
TotalFileCount uint32 `json:"totalFileCount,omitempty"`
CreateTime uint32 `json:"createTime,omitempty"`
ElapsedTime uint32 `json:"elapsedTime,omitempty"`
AnnotationFormatConfig []interface{} `json:"annotationFormatConfigomitempty"`
AnnotationFormatConfig []interface{} `json:"annotationFormatConfig,omitempty"`
}
/******************taskList end*************************/
/******************ListTrainingJobs start*************************/

View File

@ -50,14 +50,13 @@ func (l *ScheduleTaskByYamlLogic) ScheduleTaskByYaml(req *types.ScheduleTaskByYa
// 遍历子任务放入任务队列中
for _, task := range req.Tasks {
task.TaskId = taskModel.Id
//taskBytes, err := json.Marshal(task)
//if err != nil {
// return err
//}
//l.svcCtx.RedisClient.Publish(context.Background(), "test", &mqs.Msg{
// Topic: task.TaskType,
// Body: taskBytes,
//})
// 将任务数据转换成消息体
reqMessage, err := json.Marshal(task)
if err != nil {
logx.Error(err)
return err
}
l.svcCtx.RedisClient.Publish(context.Background(), task.TaskType, reqMessage)
}
return nil
}