chore(billing): simplify comment

This commit is contained in:
shaw
2026-10-02 19:52:00 +08:00
parent c2d5bbd93e
commit 432a6a461f
@@ -187,8 +187,7 @@ func (r *usageBillingRepository) applyUsageBillingEffects(ctx context.Context, t
result.BalanceOverdrafted = !sufficient result.BalanceOverdrafted = !sufficient
} }
// API Key 在请求进行中被删除时,其自身的额度/限速计数已无意义,跳过即可; // Key 已不存在时跳过其自身的额度/限速计数,其余结算项不受影响。
// 但用户余额、订阅与账号额度必须照常结算,不能因此回滚整个计费事务。
if cmd.APIKeyQuotaCost > 0 { if cmd.APIKeyQuotaCost > 0 {
exhausted, err := incrementUsageBillingAPIKeyQuota(ctx, tx, cmd.APIKeyID, cmd.APIKeyQuotaCost) exhausted, err := incrementUsageBillingAPIKeyQuota(ctx, tx, cmd.APIKeyID, cmd.APIKeyQuotaCost)
if err != nil && !errors.Is(err, service.ErrAPIKeyNotFound) { if err != nil && !errors.Is(err, service.ErrAPIKeyNotFound) {