From f939349bfafab17b77f0717518435aa42b90fe2a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 14 Apr 2026 13:40:04 +0800 Subject: [PATCH] bugfix --- llmage/accounting.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/llmage/accounting.py b/llmage/accounting.py index ade3847..2ee5361 100644 --- a/llmage/accounting.py +++ b/llmage/accounting.py @@ -201,6 +201,14 @@ where a.llmid = b.id lus.append(r) return lus +async def llm_accoung_failed(luid): + env = ServerEnv() + async with get_sor_context(env, 'llmage') as sor: + await sor.U('llmusage', { + 'id': luid, + 'accounting_status': 'failed' + }) + async def backend_accounting(): env = ServerEnv() debug(f'backend accounting started ...') @@ -216,6 +224,8 @@ async def backend_accounting(): await llm_accounting(lu) except Exception as e: exception(f'{e}, {lu.id=}') + await llm_accoung_failed(lu.id) + await asyncio.sleep(10)