satellite/accounting: use AOST to get segment usage
For better performance we should use AOST for getting data where being up to data it not very crucial. We don't care about small differences for segment limit calculation. Change-Id: I9b2d4f2bd15ebc9d1c46bc84dd51a2e9d9231506
This commit is contained in:
parent
3451162583
commit
9ce1a4e25d
@ -220,6 +220,8 @@ func (usage *Service) GetProjectSegments(ctx context.Context, projectID uuid.UUI
|
||||
|
||||
total, err := usage.metabaseDB.GetProjectSegmentCount(ctx, metabase.GetProjectSegmentCount{
|
||||
ProjectID: projectID,
|
||||
|
||||
AsOfSystemInterval: usage.asOfSystemInterval,
|
||||
})
|
||||
return total, ErrProjectUsage.Wrap(err)
|
||||
}
|
||||
|
@ -243,6 +243,7 @@ func TestProjectSegmentLimitWithoutCache(t *testing.T) {
|
||||
config.Console.UsageLimits.Segment.Paid = 5
|
||||
// this effectively disable live accounting cache
|
||||
config.LiveAccounting.BandwidthCacheTTL = -1
|
||||
config.LiveAccounting.AsOfSystemInterval = 0
|
||||
},
|
||||
},
|
||||
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
||||
|
Loading…
Reference in New Issue
Block a user