Skip to content

Commit

Permalink
use default value
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelmsmith committed Dec 21, 2023
1 parent cd5dc29 commit efe90e9
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.get(field, None)
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.get(field, None)
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 efe90e9

Please sign in to comment.