fix(workbench): serialize events and target work order sync

This commit is contained in:
2026-10-08 15:41:49 +08:00
parent b70283c2ff
commit 4a63fcd7ff
20 changed files with 673 additions and 90 deletions
+3
View File
@@ -12,6 +12,7 @@ from psycopg.types.json import Jsonb
from app.domain.schemas.shared import TimeRange
from app.services.content_digest import digest
from app.infra.db.postgresql.workbench_events import lock_event_transaction_sync
from .errors import SampleFailure, ensure
from .auth import Identity
@@ -113,6 +114,8 @@ class PostgresStore:
lost = False
try:
with self.connection() as conn:
if "work_order" in key:
lock_event_transaction_sync(conn)
conn.execute("SELECT pg_advisory_xact_lock(hashtextextended(%s,0))",
("peripheral-sample:" + who.project_id,))
cached, request_digest = self._cached(conn, who, key, command)