From 432a6a461f771b22818a88f2c53bf53d1a48adbc Mon Sep 17 00:00:00 2001 From: shaw Date: Fri, 2 Oct 2026 19:52:00 +0800 Subject: [PATCH] chore(billing): simplify comment --- backend/internal/repository/usage_billing_repo.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/internal/repository/usage_billing_repo.go b/backend/internal/repository/usage_billing_repo.go index 9732d52355..bfb1bb0de5 100644 --- a/backend/internal/repository/usage_billing_repo.go +++ b/backend/internal/repository/usage_billing_repo.go @@ -187,8 +187,7 @@ func (r *usageBillingRepository) applyUsageBillingEffects(ctx context.Context, t result.BalanceOverdrafted = !sufficient } - // API Key 在请求进行中被删除时,其自身的额度/限速计数已无意义,跳过即可; - // 但用户余额、订阅与账号额度必须照常结算,不能因此回滚整个计费事务。 + // Key 已不存在时跳过其自身的额度/限速计数,其余结算项不受影响。 if cmd.APIKeyQuotaCost > 0 { exhausted, err := incrementUsageBillingAPIKeyQuota(ctx, tx, cmd.APIKeyID, cmd.APIKeyQuotaCost) if err != nil && !errors.Is(err, service.ErrAPIKeyNotFound) {