Merge remote-tracking branch 'origin/master' into master-wq
Former-commit-id: 6c5ab94b5e5bb2eb9e4bb271563caf0d1ab963fc
This commit is contained in:
commit
5738c04525
|
@ -120,6 +120,7 @@ func (l *PageListTaskLogic) updateTaskStatus(tasklist []*types.TaskModel, ch cha
|
|||
tx = l.svcCtx.DbEngin.Model(task).Table("task").Where("deleted_at is null").Updates(task)
|
||||
if tx.Error != nil {
|
||||
logx.Errorf(tx.Error.Error())
|
||||
ch <- struct{}{}
|
||||
return
|
||||
}
|
||||
ch <- struct{}{}
|
||||
|
@ -138,6 +139,7 @@ func (l *PageListTaskLogic) updateTaskStatus(tasklist []*types.TaskModel, ch cha
|
|||
tx = l.svcCtx.DbEngin.Model(task).Table("task").Where("deleted_at is null").Updates(task)
|
||||
if tx.Error != nil {
|
||||
logx.Errorf(tx.Error.Error())
|
||||
ch <- struct{}{}
|
||||
return
|
||||
}
|
||||
ch <- struct{}{}
|
||||
|
|
|
@ -2,6 +2,7 @@ package schedule
|
|||
|
||||
import (
|
||||
"context"
|
||||
"github.com/pkg/errors"
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/storeLink"
|
||||
|
||||
"gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc"
|
||||
|
@ -28,7 +29,8 @@ func (l *ScheduleGetDatasetsLogic) ScheduleGetDatasets(req *types.AiDatasetsReq)
|
|||
resp = &types.AiDatasetsResp{}
|
||||
names, err := storeLink.GetDatasetsNames(l.ctx, l.svcCtx.Scheduler.AiService.AiCollectorAdapterMap[req.AdapterId])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
logx.Errorf("GetDatasetsNames err: %v", err)
|
||||
return nil, errors.New("网络异常,请稍后重试.")
|
||||
}
|
||||
resp.Datasets = names
|
||||
return resp, nil
|
||||
|
|
|
@ -112,8 +112,6 @@ func (s *AiStorage) SaveAiTask(taskId int64, option *option.AiOption, clusterId
|
|||
return err
|
||||
}
|
||||
|
||||
del, _ := time.Parse(constants.Layout, constants.Layout)
|
||||
|
||||
aiTaskModel := models.TaskAi{
|
||||
TaskId: taskId,
|
||||
AdapterId: aId,
|
||||
|
@ -127,7 +125,6 @@ func (s *AiStorage) SaveAiTask(taskId int64, option *option.AiOption, clusterId
|
|||
Status: status,
|
||||
Msg: msg,
|
||||
Card: option.ComputeCard,
|
||||
DeletedAt: del,
|
||||
CommitTime: time.Now(),
|
||||
}
|
||||
// 保存任务数据到数据库
|
||||
|
|
|
@ -503,8 +503,9 @@ func (s *ShuguangAi) GetTrainingTaskLog(ctx context.Context, taskId string, inst
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if resp.Code != "0" {
|
||||
return "", errors.New(resp.Msg)
|
||||
resp.Data.Content = "waiting for logs..."
|
||||
}
|
||||
|
||||
return resp.Data.Content, nil
|
||||
|
|
|
@ -36,24 +36,24 @@ type (
|
|||
}
|
||||
|
||||
TaskAi struct {
|
||||
Id int64 `db:"id"` // id
|
||||
TaskId int64 `db:"task_id"` // 任务id
|
||||
AdapterId int64 `db:"adapter_id"` // 适配器id
|
||||
AdapterName string `db:"adapter_name"` // 适配器名称
|
||||
ClusterId int64 `db:"cluster_id"` // 集群id
|
||||
ClusterName string `db:"cluster_name"` // 集群名称
|
||||
Name string `db:"name"` // 任务名
|
||||
Replica int64 `db:"replica"` // 执行数
|
||||
JobId string `db:"job_id"` // 集群返回任务id
|
||||
Strategy string `db:"strategy"` // 主任务使用策略
|
||||
Status string `db:"status"` // 任务状态
|
||||
Msg string `db:"msg"` // 集群返回任务信息
|
||||
CommitTime time.Time `db:"commit_time"` // 提交时间
|
||||
StartTime string `db:"start_time"` // 开始时间
|
||||
EndTime string `db:"end_time"` // 结束时间
|
||||
TaskType string `db:"task_type"`
|
||||
DeletedAt time.Time `db:"deleted_at"`
|
||||
Card string `db:"card"`
|
||||
Id int64 `db:"id"` // id
|
||||
TaskId int64 `db:"task_id"` // 任务id
|
||||
AdapterId int64 `db:"adapter_id"` // 适配器id
|
||||
AdapterName string `db:"adapter_name"` // 适配器名称
|
||||
ClusterId int64 `db:"cluster_id"` // 集群id
|
||||
ClusterName string `db:"cluster_name"` // 集群名称
|
||||
Name string `db:"name"` // 任务名
|
||||
Replica int64 `db:"replica"` // 执行数
|
||||
JobId string `db:"job_id"` // 集群返回任务id
|
||||
Strategy string `db:"strategy"` // 主任务使用策略
|
||||
Status string `db:"status"` // 任务状态
|
||||
Msg string `db:"msg"` // 集群返回任务信息
|
||||
CommitTime time.Time `db:"commit_time"` // 提交时间
|
||||
StartTime string `db:"start_time"` // 开始时间
|
||||
EndTime string `db:"end_time"` // 结束时间
|
||||
TaskType string `db:"task_type"`
|
||||
DeletedAt *time.Time `db:"deleted_at"`
|
||||
Card string `db:"card"`
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue