mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	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>
This commit is contained in:
		@@ -806,6 +806,14 @@ func (repo *Repository) updateSize(e Engine) error {
 | 
			
		||||
		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
 | 
			
		||||
	_, err = e.ID(repo.ID).Cols("size").Update(repo)
 | 
			
		||||
	return err
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user