debug: backend_accounting 加 info 级别日志追踪记账循环
- info 替代 debug 确保启动日志必定输出 - 每轮循环后打印 got N records - exception 消息加前缀便于搜索 用于排查 receive 1166 条记录但循环不处理的根因
This commit is contained in:
parent
f6d4462ed8
commit
3e386ed86f
@ -2,7 +2,7 @@ import asyncio
|
||||
import json
|
||||
import time
|
||||
from datetime import datetime, timedelta
|
||||
from appPublic.log import exception, debug
|
||||
from appPublic.log import exception, debug, info
|
||||
from appPublic.uniqueID import getID
|
||||
from appPublic.dictObject import DictObject
|
||||
from sqlor.dbpools import get_sor_context
|
||||
@ -327,13 +327,14 @@ order by failed_time desc limit {page_size} offset {offset}"""
|
||||
|
||||
async def backend_accounting():
|
||||
env = ServerEnv()
|
||||
debug(f'backend accounting started ...')
|
||||
info(f"backend accounting started ...")
|
||||
last_backup_date = None
|
||||
while True:
|
||||
try:
|
||||
lus = await get_accounting_llmusages()
|
||||
info(f"accounting loop: got {len(lus)} records")
|
||||
except Exception as e:
|
||||
exception(f'{e}')
|
||||
exception(f"get_accounting_llmusages failed: {e}")
|
||||
lus = []
|
||||
for lu in lus:
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user