Browse Source

add jobtype judge

tags/v1.21.12.1
yuyuanshifu 4 years ago
parent
commit
df94305254
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