From a3a15ae6662df36b07ca4284e815326549281fde Mon Sep 17 00:00:00 2001 From: ymq Date: Sun, 16 Aug 2026 23:43:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(audit):=20created=5Fat=20=E5=BE=AE=E7=A7=92?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6=EF=BC=8C=E4=BF=9D=E8=AF=81=20append-only=20?= =?UTF-8?q?=E8=BD=A8=E8=BF=B9=E5=8F=AF=E7=B2=BE=E7=A1=AE=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/audit.py | 3 +++ 1 file changed, 3 insertions(+) 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)