Skip to content

Commit bde9ba8

Browse files
committed
Update usage.go
1 parent d2cff6b commit bde9ba8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

premium/usage.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ func (u *BatchUpdater) setupAWSMarketplace() error {
302302
}
303303
u.teamName = "AWS_MARKETPLACE"
304304
// This needs to be larger than normal, because we can only send a single usage record per second (from each compute node)
305-
u.batchLimit = 1000000000
305+
u.batchLimit = 3294967294
306306

307-
u.minTimeBetweenFlushes = 1 * time.Minute
307+
u.minTimeBetweenFlushes = 60 * time.Minute
308308
u.maxRetries = max(u.maxRetries, marketplaceMinRetries)
309309
u.backgroundUpdater()
310310

@@ -601,6 +601,10 @@ func (u *BatchUpdater) reportUsageToAWSMarketplace(ctx context.Context, rows uin
601601
}
602602

603603
func (u *BatchUpdater) updateMarketplaceUsage(ctx context.Context, rows uint32) error {
604+
if u.lastUpdateTime.IsZero() {
605+
u.lastUpdateTime = u.timeFunc().UTC()
606+
}
607+
604608
var lastErr error
605609
for retry := 0; retry < u.maxRetries; retry++ {
606610
u.logger.Debug().Int("try", retry).Int("max_retries", u.maxRetries).Uint32("rows", rows).Msg("updating usage")

0 commit comments

Comments
 (0)