Skip to content

Commit

Permalink
fix: rows synced doesn't exist (#19469)
Browse files Browse the repository at this point in the history
* fix rows synced doesn't exist

* use default value
  • Loading branch information
raquelmsmith authored and fuziontech committed Jan 4, 2024
1 parent 757f6f9 commit 5271523
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ee/billing/quota_limiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,12 @@ def set_org_usage_summary(
new_usage = copy.deepcopy(new_usage)

for field in ["events", "recordings", "rows_synced"]:
resource_usage = new_usage[field] # type: ignore
resource_usage = new_usage.get(field, {"limit": None, "usage": 0, "todays_usage": 0})
if not resource_usage:
continue

if todays_usage:
resource_usage["todays_usage"] = todays_usage[field] # type: ignore
resource_usage["todays_usage"] = todays_usage.get(field, 0)
else:
# TRICKY: If we are not explictly setting todays_usage, we want to reset it to 0 IF the incoming new_usage is different
if (organization.usage or {}).get(field, {}).get("usage") != resource_usage.get("usage"):
Expand Down

0 comments on commit 5271523

Please sign in to comment.