Merge pull request 'merge conflict' (#171) from zhouqunjie/pcm-coordinator:master into master

Former-commit-id: a05b4cc310d2b08ac7d3a4e81f2fb7aeaffcc7df
This commit is contained in:
zhouqunjie 2024-05-14 10:47:04 +08:00
commit 1127b2edd3
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package hpc
import ( import (
"context" "context"
"errors"
clientCore "gitlink.org.cn/JointCloud/pcm-coordinator/api/client" clientCore "gitlink.org.cn/JointCloud/pcm-coordinator/api/client"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants"
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models" "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
@ -63,7 +64,9 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t
l.svcCtx.DbEngin.Raw("SELECT nickname FROM `t_cluster` where id = ?", clusterId).Scan(&clusterName) l.svcCtx.DbEngin.Raw("SELECT nickname FROM `t_cluster` where id = ?", clusterId).Scan(&clusterName)
l.svcCtx.DbEngin.Raw("SELECT adapter_id FROM `t_cluster` where id = ?", clusterId).Scan(&adapterId) l.svcCtx.DbEngin.Raw("SELECT adapter_id FROM `t_cluster` where id = ?", clusterId).Scan(&adapterId)
l.svcCtx.DbEngin.Raw("SELECT name FROM `t_adapter` where id = ?", adapterId).Scan(&adapterName) l.svcCtx.DbEngin.Raw("SELECT name FROM `t_adapter` where id = ?", adapterId).Scan(&adapterName)
if len(adapterName) == 0 || adapterName == "" {
return nil, errors.New("no corresponding adapter found")
}
env, _ := json.Marshal(req.Environment) env, _ := json.Marshal(req.Environment)
hpcInfo := models.TaskHpc{ hpcInfo := models.TaskHpc{

View File

@ -91,7 +91,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
NamingStrategy: schema.NamingStrategy{ NamingStrategy: schema.NamingStrategy{
SingularTable: true, // 使用单数表名,启用该选项,此时,`User` 的表名应该是 `t_user` SingularTable: true, // 使用单数表名,启用该选项,此时,`User` 的表名应该是 `t_user`
}, },
Logger: logger.Default.LogMode(logger.Info), Logger: logger.Default.LogMode(logger.Error),
}) })
if err != nil { if err != nil {
logx.Errorf("数据库连接失败, err%v", err) logx.Errorf("数据库连接失败, err%v", err)