bugfix
This commit is contained in:
parent
f52a0e824c
commit
28af0c1e37
@ -147,10 +147,13 @@ async def query_task_status(request, upappid, apinames, luid, userid, taskid):
|
|||||||
if rzt.status == 'SUCCEEDED':
|
if rzt.status == 'SUCCEEDED':
|
||||||
if llm.ppid:
|
if llm.ppid:
|
||||||
try:
|
try:
|
||||||
chargings = await llm_charging(sor,
|
charging = await llm_charging(sor,
|
||||||
llm.ppid, llmusage)
|
llm.ppid, llmusage)
|
||||||
llmusage.amount = chargings.amount
|
if charging:
|
||||||
llmusage.cost = chargings.cost
|
llmusage.amount = charging.amount
|
||||||
|
llmusage.cost = charging.cost
|
||||||
|
else:
|
||||||
|
llmusage.amount = cost = 0.0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
e = Exception(f'{llm.pid} charging error{e}')
|
e = Exception(f'{llm.pid} charging error{e}')
|
||||||
exception(f'{e}')
|
exception(f'{e}')
|
||||||
|
|||||||
@ -97,8 +97,11 @@ async def uapi_request(request, llm, sor, callerid, callerorgid, params_kw=None)
|
|||||||
if llm.ppid and callerorgid:
|
if llm.ppid and callerorgid:
|
||||||
try:
|
try:
|
||||||
chargings = await llm_charging(sor, llm.ppid, llmusage)
|
chargings = await llm_charging(sor, llm.ppid, llmusage)
|
||||||
|
if chargings:
|
||||||
llmusage.amount = chargings.amount
|
llmusage.amount = chargings.amount
|
||||||
llmusage.cost = chargings.cost
|
llmusage.cost = chargings.cost
|
||||||
|
else:
|
||||||
|
llmusage.amount = llmusage.cost = 0.00
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
e = Exception(f'{llm.pid} charging error{e}')
|
e = Exception(f'{llm.pid} charging error{e}')
|
||||||
exception(f'{e}')
|
exception(f'{e}')
|
||||||
|
|||||||
@ -59,9 +59,12 @@ async def sync_uapi_request(request, llm, sor, callerid, callerorgid, params_kw=
|
|||||||
llmusage.status = 'SUCCEEDED'
|
llmusage.status = 'SUCCEEDED'
|
||||||
if llm.ppid:
|
if llm.ppid:
|
||||||
try:
|
try:
|
||||||
chargings = await llm_charging(sor, llm.ppid, llmusage)
|
charging = await llm_charging(sor, llm.ppid, llmusage)
|
||||||
llmusage.amount = chargings.amount
|
if charging:
|
||||||
llmusage.cost = chargings.cost
|
llmusage.amount = charging.amount
|
||||||
|
llmusage.cost = charging.cost
|
||||||
|
else:
|
||||||
|
llmusage.amount = llmusage.cost = 0.0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
e = Exception(f'{llm.pid} charging error{e}')
|
e = Exception(f'{llm.pid} charging error{e}')
|
||||||
exception(f'{e}')
|
exception(f'{e}')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user