Skip to content

Commit 8721bdc

Browse files
authored
fix: Require Row count to be greater than 0 (#2259)
#### Summary Currently when we send usage we iterate over all possible tables. In cases where a table had a non 0 value earlier in the sync it is still included in every subsequent report. This leads us to have large numbers of `row_count = 0` records in our DB This change will eliminate the SDK from sending these records
1 parent cd611d3 commit 8721bdc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

premium/usage.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ func (u *BatchUpdater) getTableUsage() (usage []cqapi.UsageIncreaseTablesInner,
443443
defer u.Unlock()
444444

445445
for key, value := range u.tables {
446+
if value == 0 {
447+
continue
448+
}
446449
usage = append(usage, cqapi.UsageIncreaseTablesInner{
447450
Name: key,
448451
Rows: int(value),

0 commit comments

Comments
 (0)