Subtract FREE_TIER_MONTHLY_SPENDING_LIMIT from reported monthly spend (#19358)
Release Notes: - N/A
This commit is contained in:
parent
455f241c6a
commit
8c910540ed
5 changed files with 47 additions and 52 deletions
|
@ -469,7 +469,9 @@ async fn check_usage_limit(
|
|||
));
|
||||
}
|
||||
|
||||
if usage.spending_this_month >= Cents(claims.max_monthly_spend_in_cents) {
|
||||
if (usage.spending_this_month - FREE_TIER_MONTHLY_SPENDING_LIMIT)
|
||||
>= Cents(claims.max_monthly_spend_in_cents)
|
||||
{
|
||||
return Err(Error::Http(
|
||||
StatusCode::FORBIDDEN,
|
||||
"Maximum spending limit reached for this month.".to_string(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue