Compare commits

..

2 Commits

Author SHA1 Message Date
27a846c3c9 buggix 2026-05-22 13:01:43 +08:00
6a430112f4 buggix 2026-05-22 12:58:03 +08:00

View File

@ -169,9 +169,11 @@ async def get_accounting_llmusages(luid=None):
dt = datetime.fromtimestamp(t)
tsstr = dt.strftime('%Y-%m-%d %H:%M:%S.') + f'{dt.microsecond // 1000:03d}'
async with get_sor_context(env, 'llmage') as sor:
sql = """select a.*, b.ppid
from llmusage a, llm b
sql = """select a.*, c.ppid
from llmusage a, llm b, llm_api_map c
where a.llmid = b.id
and a.llmid = c.llmid
and c.isdefaultcatelog = '1'
and a.status = 'SUCCEEDED'
and a.use_time < ${tsstr}$
and a.accounting_status='created'"""
@ -196,7 +198,7 @@ where a.llmid = b.id
try:
if isinstance(r.usages, str):
r.usages = json.loads(r.usages)
d = await llm_charging(r.ppid, r)
d = await env.buffered_charging(r.ppid, r.usages)
except Exception as e:
await llm_accoung_failed(r.id)
exception(f'{r.ppid=}, {r.usages=} llm_charging() failed,{e}')