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

Function lockWorkflowForUpdate

apps/sim/lib/workflows/persistence/utils.ts:42–57  ·  view source on GitHub ↗
(tx: DbOrTx, workflowId: string)

Source from the content-addressed store, hash-verified

40}
41
42async function lockWorkflowForUpdate(tx: DbOrTx, workflowId: string): Promise<boolean> {
43 const query = tx.select({ id: workflow.id }).from(workflow).where(eq(workflow.id, workflowId))
44
45 if ('limit' in query && typeof query.limit === 'function') {
46 const limited = query.limit(1)
47 const rows =
48 'for' in limited && typeof limited.for === 'function'
49 ? await limited.for('update')
50 : await limited
51 return hasReturnedRows(rows)
52 }
53
54 const rows = await query
55
56 return hasReturnedRows(rows)
57}
58
59export interface WorkflowDeploymentVersionResponse {
60 id: string

Callers 5

deployWorkflowFunction · 0.85
executeUndeployFunction · 0.85
activateWorkflowVersionFunction · 0.85

Calls 2

hasReturnedRowsFunction · 0.85
eqFunction · 0.50

Tested by

no test coverage detected