Browse Source

fix bug

tags/v1.21.12.1
yuyuanshifu 5 years ago
parent
commit
328e79c6a2
2 changed files with 12 additions and 3 deletions
  1. +10
    -0
      routers/repo/attachment.go
  2. +2
    -3
      routers/repo/cloudbrain.go

+ 10
- 0
routers/repo/attachment.go View File

@@ -659,6 +659,16 @@ func QueryPrivateDataset(ctx *context.Context){

func queryDatasets(ctx *context.Context, attachs []*models.AttachmentUsername) {
var datasets []CloudBrainDataset
if len(attachs) == 0 {
log.Info("dataset is null")
ctx.JSON(200, map[string]string{
"result_code": "0",
"error_msg": "",
"data": "",
})
return
}

for _, attch := range attachs {
has,err := storage.Attachments.HasObject(models.AttachmentRelativePath(attch.UUID))
if err != nil || !has {


+ 2
- 3
routers/repo/cloudbrain.go View File

@@ -264,12 +264,11 @@ func downloadCode(repo *models.Repository, codePath string) error {
command := "git clone " + repo.CloneLink().HTTPS + " " + codePath
cmd := exec.Command("/bin/bash", "-c", command)
output, err := cmd.Output()
log.Info(string(output))
if err != nil {
log.Error("exec.Command failed:%v", err)
log.Error("exec.Command(%s) failed:%v", command, err)
return err
}

log.Info(string(output))

return nil
}

Loading…
Cancel
Save