feat(balance): pass llmid to finalize_balance for cold-start max_cost

This commit is contained in:
yumoqing 2026-08-04 18:36:10 +08:00
parent a04b99c6c3
commit 947b83ae65

View File

@ -1627,7 +1627,8 @@ WHERE resource_ref_id = ${llm_id}$ AND product_type = 'llm_model' LIMIT 1"""
luid = getattr(llmusage, 'id', None)
if luid:
from llmage.balance import finalize_balance
await finalize_balance(ServerEnv(), luid, customer_amount)
await finalize_balance(ServerEnv(), luid, customer_amount,
llmid=getattr(llmusage, 'llmid', None))
except Exception as e:
exception(f'finalize_balance failed (non-critical): {e}')