Browse Source

models: include LFS when calculating repo size (#11060)

Fixes #9369

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
for-closed-social
Cuong Manh Le 4 years ago
committed by GitHub
parent
commit
d98df0ede3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      models/repo.go

+ 8
- 0
models/repo.go View File

@ -806,6 +806,14 @@ func (repo *Repository) updateSize(e Engine) error {
return fmt.Errorf("updateSize: %v", err) return fmt.Errorf("updateSize: %v", err)
} }
objs, err := repo.GetLFSMetaObjects(-1, 0)
if err != nil {
return fmt.Errorf("updateSize: GetLFSMetaObjects: %v", err)
}
for _, obj := range objs {
size += obj.Size
}
repo.Size = size repo.Size = size
_, err = e.ID(repo.ID).Cols("size").Update(repo) _, err = e.ID(repo.ID).Cols("size").Update(repo)
return err return err

Loading…
Cancel
Save