Browse Source

提交代码

tags/v1.22.11.3^2
ychao_1983 3 years ago
parent
commit
5088e8da18
2 changed files with 2 additions and 4 deletions
  1. +1
    -3
      services/cloudbrain/cloudbrainTask/notebook.go
  2. +1
    -1
      services/cloudbrain/cloudbrainTask/train.go

+ 1
- 3
services/cloudbrain/cloudbrainTask/notebook.go View File

@@ -81,8 +81,6 @@ func cloudBrainFileNoteBookCreate(ctx *context.Context, option api.CreateFileNot
jobName := util.ConvertDisplayJobNameToJobName(displayJobName)
jobType := string(models.JobTypeDebug)

codePath := getCodePath(jobName)

lock := redis_lock.NewDistributeLock(redis_key.CloudbrainBindingJobNameKey(fmt.Sprint(repo.ID), jobType, displayJobName))
defer lock.UnLock()
isOk, err := lock.Lock(models.CloudbrainKeyDuration)
@@ -126,7 +124,7 @@ func cloudBrainFileNoteBookCreate(ctx *context.Context, option api.CreateFileNot
return
}

errStr := uploadCodeFile(sourceRepo, codePath, option.BranchName, option.File, jobName)
errStr := uploadCodeFile(sourceRepo, getCodePath(jobName), option.BranchName, option.File, jobName)
if errStr != "" {
ctx.JSON(http.StatusOK, models.BaseErrorMessageApi(ctx.Tr("repo.notebook_file_not_exist")))
return


+ 1
- 1
services/cloudbrain/cloudbrainTask/train.go View File

@@ -812,7 +812,7 @@ func uploadCodeToMinio(codePath, jobName, parentDir string) error {

func uploadOneFileToMinio(codePath, filePath, jobName, parentDir string) error {
destObject := setting.CBCodePathPrefix + jobName + parentDir + path.Base(filePath)
sourceFile := codePath + filePath
sourceFile := codePath + "/" + filePath
err := storage.Attachments.UploadObject(destObject, sourceFile)
if err != nil {
log.Error("UploadObject(%s) failed: %s", filePath, err.Error())


Loading…
Cancel
Save