MCPcopy Index your code
hub / github.com/simstudioai/sim / acquireForkEdgeLock

Function acquireForkEdgeLock

apps/sim/lib/workspaces/fork/lineage/lineage.ts:91–95  ·  view source on GitHub ↗
(tx: DbOrTx, childWorkspaceId: string)

Source from the content-addressed store, hash-verified

89 * unnecessary serialization, never a correctness issue.
90 */
91export async function acquireForkEdgeLock(tx: DbOrTx, childWorkspaceId: string): Promise<void> {
92 await tx.execute(
93 sql`select pg_advisory_xact_lock(hashtextextended(${`fork-edge:${childWorkspaceId}`}, 0))`
94 )
95}
96
97/**
98 * Serialize every promote/rollback whose TARGET is this workspace. Sibling forks

Callers 3

rollbackForkFunction · 0.90
promoteForkFunction · 0.90
route.tsFile · 0.90

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected