Skip to content

Commit

Permalink
stores: use sum over total shards
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Feb 15, 2024
1 parent 47a91ac commit 3e463cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stores/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,9 @@ func (s *SQLStore) ObjectsStats(ctx context.Context, opts api.ObjectsStatsOpts)

var totalSectors int64
err = s.db.
Model(&dbSector{}).
Count(&totalSectors).Error
Model(&dbSlab{}).
Select("COALESCE(SUM(total_shards), 0)").
Scan(&totalSectors).Error
if err != nil {
return api.ObjectsStatsResponse{}, err
}
Expand Down

0 comments on commit 3e463cf

Please sign in to comment.