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

Function acquireWorkflowMcpServerLock

apps/sim/lib/mcp/server-locks.ts:14–17  ·  view source on GitHub ↗
(tx: DbOrTx, serverId: string)

Source from the content-addressed store, hash-verified

12}
13
14export async function acquireWorkflowMcpServerLock(tx: DbOrTx, serverId: string): Promise<void> {
15 await setWorkflowMcpTransactionLockTimeout(tx)
16 await tx.execute(sql`select pg_advisory_xact_lock(hashtextextended(${serverId}, 0))`)
17}
18
19export function isWorkflowMcpServerLockTimeout(error: unknown): boolean {
20 return getPostgresErrorCode(error) === LOCK_NOT_AVAILABLE_SQLSTATE

Calls 2

executeMethod · 0.65

Tested by

no test coverage detected