Browse Source

Merge pull request 'add jobtype judge' (#146) from jobtype into develop

Reviewed-by: 史梦园 <1729788216@qq.com>
tags/v1.21.12.1
史梦园 4 years ago
parent
commit
224f8b1b99
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      routers/repo/cloudbrain.go

+ 6
- 0
routers/repo/cloudbrain.go View File

@@ -124,6 +124,12 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
uuid := form.Attachment
jobType := form.JobType
codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath

if jobType != string(models.JobTypeBenchmark) && jobType != string(models.JobTypeDebug) {
log.Error("jobtype error:", jobType)
ctx.RenderWithErr("jobtype error", tplCloudBrainNew, &form)
return
}
repo := ctx.Repo.Repository
downloadCode(repo, codePath)



Loading…
Cancel
Save