Browse Source

migrations/v16: use continue not return for bad records

pull/4280/head
Unknwon 8 years ago
parent
commit
b116dc506b
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 6
      models/migrations/v16.go

6
models/migrations/v16.go

@ -49,7 +49,7 @@ func updateRepositorySizes(x *xorm.Engine) (err error) {
for _, repo := range repos {
if repo.Name == "." || repo.Name == ".." {
return nil
continue
}
user := new(User)
@ -57,14 +57,14 @@ func updateRepositorySizes(x *xorm.Engine) (err error) {
if err != nil {
return fmt.Errorf("query owner of repository [repo_id: %d, owner_id: %d]: %v", repo.ID, repo.OwnerID, err)
} else if !has {
return nil
continue
}
repoPath := filepath.Join(setting.RepoRootPath, strings.ToLower(user.Name), strings.ToLower(repo.Name)) + ".git"
countObject, err := git.GetRepoSize(repoPath)
if err != nil {
log.Warn("GetRepoSize: %v", err)
return nil
continue
}
repo.Size = countObject.Size + countObject.SizePack

Loading…
Cancel
Save