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
|
||||
|
|
|
@ -52,7 +52,7 @@ type (
|
|||
StartTime string `db:"start_time"` // 开始时间
|
||||
EndTime string `db:"end_time"` // 结束时间
|
||||
TaskType string `db:"task_type"`
|
||||
DeletedAt time.Time `db:"deleted_at"`
|
||||
DeletedAt *time.Time `db:"deleted_at"`
|
||||
Card string `db:"card"`
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue