redis队列替换kafka
Former-commit-id: 744a11a0d88e451f77fd3ea525f219e968bba701
This commit is contained in:
parent
f66c9b8b7b
commit
bdb1ad3d59
|
@ -341,7 +341,7 @@ type ImportTasks {
|
|||
TotalFileCount uint32 `json:"totalFileCount,omitempty"`
|
||||
CreateTime uint32 `json:"createTime,omitempty"`
|
||||
ElapsedTime uint32 `json:"elapsedTime,omitempty"`
|
||||
AnnotationFormatConfig []interface{} `json:"annotationFormatConfig,omitempty"`
|
||||
AnnotationFormatConfig []interface{} `json:"annotationFormatConfig,omitempty"`
|
||||
}
|
||||
/******************taskList end*************************/
|
||||
/******************ListTrainingJobs start*************************/
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue