fix bug
Former-commit-id: a32dab848d0e2055a62190de1461d4ba7be83ca5
This commit is contained in:
parent
8bc4176932
commit
91c38d66fd
|
@ -50,6 +50,11 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
|
||||||
|
|
||||||
var clusterIds []int64
|
var clusterIds []int64
|
||||||
l.svcCtx.DbEngin.Raw("SELECT id FROM `t_cluster` where adapter_id in ? and label = ?", req.AdapterIds, req.ClusterType).Scan(&clusterIds)
|
l.svcCtx.DbEngin.Raw("SELECT id FROM `t_cluster` where adapter_id in ? and label = ?", req.AdapterIds, req.ClusterType).Scan(&clusterIds)
|
||||||
|
if len(clusterIds) == 0 || clusterIds == nil {
|
||||||
|
resp.Code = 400
|
||||||
|
resp.Msg = "no cluster found"
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
var clusterName string
|
var clusterName string
|
||||||
var adapterId int64
|
var adapterId int64
|
||||||
|
@ -61,12 +66,6 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
|
||||||
|
|
||||||
env, _ := json.Marshal(req.Environment)
|
env, _ := json.Marshal(req.Environment)
|
||||||
|
|
||||||
if len(clusterIds) == 0 || clusterIds == nil {
|
|
||||||
resp.Code = 400
|
|
||||||
resp.Msg = "no cluster found"
|
|
||||||
return resp, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
hpcInfo := models.TaskHpc{
|
hpcInfo := models.TaskHpc{
|
||||||
TaskId: taskModel.Id,
|
TaskId: taskModel.Id,
|
||||||
AdapterId: uint(adapterId),
|
AdapterId: uint(adapterId),
|
||||||
|
|
Loading…
Reference in New Issue