diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 4a82a2031..451a2a77e 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -1353,8 +1353,11 @@ func CloudbrainsVersionList(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int, e } func CreateCloudbrain(cloudbrain *Cloudbrain) (err error) { + sess := x.NewSession() + defer sess.Close() + cloudbrain.TrainJobDuration = DURATION_STR_ZERO - if _, err = x.Insert(cloudbrain); err != nil { + if _, err = sess.NoAutoTime().Insert(cloudbrain); err != nil { return err } return nil diff --git a/modules/cloudbrain/cloudbrain.go b/modules/cloudbrain/cloudbrain.go index b68004b98..f450c8b27 100755 --- a/modules/cloudbrain/cloudbrain.go +++ b/modules/cloudbrain/cloudbrain.go @@ -297,6 +297,7 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, DatasetName: datasetName, Parameters: params, CreatedUnix: createTime, + UpdatedUnix: createTime, }) if err != nil { diff --git a/modules/modelarts/modelarts.go b/modules/modelarts/modelarts.go index 3f3d3e55b..78b40fd56 100755 --- a/modules/modelarts/modelarts.go +++ b/modules/modelarts/modelarts.go @@ -238,6 +238,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin Uuid: uuid, ComputeResource: models.NPUResource, CreatedUnix: createTime, + UpdatedUnix: createTime, }) if err != nil { @@ -292,6 +293,7 @@ func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, desc Image: imageName, Description: description, CreatedUnix: createTime, + UpdatedUnix: createTime, }) if err != nil { @@ -370,6 +372,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error VersionCount: req.VersionCount, TotalVersionCount: req.TotalVersionCount, CreatedUnix: createTime, + UpdatedUnix: createTime, }) if err != nil { @@ -459,6 +462,7 @@ func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, job TotalVersionCount: VersionTaskList[0].TotalVersionCount + 1, VersionCount: VersionListCount + 1, CreatedUnix: createTime, + UpdatedUnix: createTime, }) if err != nil { log.Error("CreateCloudbrain(%s) failed:%v", req.JobName, err.Error()) @@ -601,6 +605,7 @@ func GenerateInferenceJob(ctx *context.Context, req *GenerateInferenceJobReq) (e CkptName: req.CkptName, ResultUrl: req.ResultUrl, CreatedUnix: createTime, + UpdatedUnix: createTime, }) if err != nil {