This commit is contained in:
yumoqing 2026-03-30 15:32:59 +08:00
parent b2dc07ba26
commit 9dd73339ce

View File

@ -205,8 +205,12 @@ async def query_task_status(request, upappid, apiname, luid, userid, taskid):
changed.cost = 0 changed.cost = 0
await add_new_llmusage_output(luid, changed) await add_new_llmusage_output(luid, changed)
if llmusage.accounting_status != 'accounted' and changed.amount > 0.00001: if llmusage.accounting_status != 'accounted' and changed.amount > 0.00001:
await llm_accounting(request, llmusage) llmusage.amount = changed.amount
debug(f'{changed=} accounted ') llmusage.cost = changed.cost
try:
await llm_accounting(request, llmusage)
except Exception as e:
debug(f'{changed=} accounting failed,{e=} ')
if changed.status in ['FAILED', 'SUCCEEDED']: if changed.status in ['FAILED', 'SUCCEEDED']:
return return
await asyncio.sleep(llm.query_period or 30) await asyncio.sleep(llm.query_period or 30)