fix(workbench): serialize events and target work order sync
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user