Browse Source

修复训练版本时偶尔出现没删掉原代码

tags/v1.21.12.1
liuzx 4 years ago
parent
commit
8e40989210
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      routers/repo/modelarts.go

+ 5
- 4
routers/repo/modelarts.go View File

@@ -903,10 +903,11 @@ func TrainJobCreateVersion(ctx *context.Context, form auth.CreateModelArtsTrainJ
// }

//todo: del the codeLocalPath
_, err = ioutil.ReadDir(codeLocalPath)
if err == nil {
os.RemoveAll(codeLocalPath)
}
// _, err = ioutil.ReadDir(codeLocalPath)
// if err == nil {
// os.RemoveAll(codeLocalPath)
// }
os.RemoveAll(codeLocalPath)

gitRepo, _ := git.OpenRepository(repo.RepoPath())
commitID, _ := gitRepo.GetBranchCommitID(branch_name)


Loading…
Cancel
Save