Browse Source

处理训练任务多版本不重复显示的问题

tags/v1.22.2.2^2
ychao_1983 3 years ago
parent
commit
e5a657eb39
2 changed files with 12 additions and 12 deletions
  1. +1
    -3
      models/cloudbrain.go
  2. +11
    -9
      routers/admin/cloudbrains.go

+ 1
- 3
models/cloudbrain.go View File

@@ -1075,9 +1075,7 @@ func Cloudbrains(opts *CloudbrainsOptions) ([]*CloudbrainInfo, int64, error) {
}

if (opts.IsLatestVersion) != "" {
cond = cond.And(
builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion},
)
cond = cond.And(builder.Or(builder.And(builder.Eq{"cloudbrain.is_latest_version": opts.IsLatestVersion}, builder.Eq{"cloudbrain.job_type": "TRAIN"}), builder.Neq{"cloudbrain.job_type": "TRAIN"}))
}

if len(opts.CloudbrainIDs) > 0 {


+ 11
- 9
routers/admin/cloudbrains.go View File

@@ -74,13 +74,14 @@ func CloudBrains(ctx *context.Context) {
Page: page,
PageSize: setting.UI.IssuePagingNum,
},
Keyword: keyword,
Type: debugType,
JobTypeNot: jobTypeNot,
JobStatusNot: jobStatusNot,
JobStatus: jobStatuses,
JobTypes: jobTypes,
NeedRepoInfo: true,
Keyword: keyword,
Type: debugType,
JobTypeNot: jobTypeNot,
JobStatusNot: jobStatusNot,
JobStatus: jobStatuses,
JobTypes: jobTypes,
NeedRepoInfo: true,
IsLatestVersion: modelarts.IsLatestVersion,
})
if err != nil {
ctx.ServerError("Get job failed:", err)
@@ -120,8 +121,9 @@ func DownloadCloudBrains(ctx *context.Context) {
Page: page,
PageSize: 1,
},
Type: modelarts.DebugType,
NeedRepoInfo: false,
Type: modelarts.DebugType,
NeedRepoInfo: false,
IsLatestVersion: modelarts.IsLatestVersion,
})

if err != nil {


Loading…
Cancel
Save