This commit is contained in:
2026-07-19 18:57:43 +02:00
parent 48bb6c2ec2
commit c53e2a3319
179 changed files with 9307 additions and 897 deletions
+6 -6
View File
@@ -101,16 +101,15 @@ def insert_event(row: dict) -> str:
record["created_at"] = now()
if record.get("via_agent") is None:
record["via_agent"] = 0
get_table(AUDIT_TABLE).insert(record)
get_table(AUDIT_TABLE).insert(record, ensure=False)
return record["uid"]
def insert_links(audit_uid: str, links: list[dict]) -> int:
if not links:
return 0
table = get_table(LINKS_TABLE)
stamp = now()
count = 0
records = []
for link in links:
record = _empty_link()
record.update(
@@ -121,9 +120,10 @@ def insert_links(audit_uid: str, links: list[dict]) -> int:
record["created_at"] = stamp
if not record.get("object_uid"):
continue
table.insert(record)
count += 1
return count
records.append(record)
if records:
get_table(LINKS_TABLE).insert_many(records, ensure=False)
return len(records)
def get_event(uid: str) -> Optional[dict]: