diff --git a/pipeline_service/audit.py b/pipeline_service/audit.py index cde161d..344cbe7 100644 --- a/pipeline_service/audit.py +++ b/pipeline_service/audit.py @@ -10,6 +10,7 @@ """ import logging +from datetime import datetime from sqlor.dbpools import DBPools from appPublic.uniqueID import getID @@ -54,6 +55,8 @@ async def record_audit(tenant_id, entity, entity_id, action, 'who': who, 'agent_id': agent_id, 'detail': detail, + # 微秒精度,保证 append-only 轨迹可精确排序(秒级同秒内会乱序) + 'created_at': datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f'), } if sor is not None: await sor.C('audit_log', data)