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

Function acquireForkTargetLock

apps/sim/lib/workspaces/fork/lineage/lineage.ts:104–108  ·  view source on GitHub ↗
(tx: DbOrTx, targetWorkspaceId: string)

Source from the content-addressed store, hash-verified

102 * this BEFORE {@link acquireForkEdgeLock} so the two are taken in a consistent order.
103 */
104export async function acquireForkTargetLock(tx: DbOrTx, targetWorkspaceId: string): Promise<void> {
105 await tx.execute(
106 sql`select pg_advisory_xact_lock(hashtextextended(${`fork-target:${targetWorkspaceId}`}, 0))`
107 )
108}

Callers 2

rollbackForkFunction · 0.90
promoteForkFunction · 0.90

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected