(tx: DbOrTx, serverId: string)
| 12 | } |
| 13 | |
| 14 | export 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 | |
| 19 | export function isWorkflowMcpServerLockTimeout(error: unknown): boolean { |
| 20 | return getPostgresErrorCode(error) === LOCK_NOT_AVAILABLE_SQLSTATE |
no test coverage detected