collab: Don't record billing events if billing is not enabled (#19102)
This PR adjusts the billing logic to not write any records to `billing_events` if: - The user is staff, as we don't want to bill staff members - Billing is disabled (we currently enable billing based on the presence of the Stripe API key) Release Notes: - N/A
This commit is contained in:
parent
b739cfa73f
commit
c709b66f35
2 changed files with 11 additions and 2 deletions
|
@ -409,7 +409,8 @@ impl LlmDatabase {
|
|||
monthly_usage.output_tokens as usize,
|
||||
);
|
||||
|
||||
if spending_this_month > FREE_TIER_MONTHLY_SPENDING_LIMIT
|
||||
if !is_staff
|
||||
&& spending_this_month > FREE_TIER_MONTHLY_SPENDING_LIMIT
|
||||
&& has_llm_subscription
|
||||
&& spending_this_month <= max_monthly_spend
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue