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

Function setTableTxTimeouts

apps/sim/lib/table/tx.ts:22–32  ·  view source on GitHub ↗
(
  trx: DbTransaction,
  opts?: { statementMs?: number; lockMs?: number; idleMs?: number }
)

Source from the content-addressed store, hash-verified

20 * and cleared at COMMIT/ROLLBACK before the session returns to the pool.
21 */
22export async function setTableTxTimeouts(
23 trx: DbTransaction,
24 opts?: { statementMs?: number; lockMs?: number; idleMs?: number }
25) {
26 const s = opts?.statementMs ?? 10_000
27 const l = opts?.lockMs ?? 3_000
28 const i = opts?.idleMs ?? 5_000
29 await trx.execute(sql.raw(`SET LOCAL statement_timeout = '${s}ms'`))
30 await trx.execute(sql.raw(`SET LOCAL lock_timeout = '${l}ms'`))
31 await trx.execute(sql.raw(`SET LOCAL idle_in_transaction_session_timeout = '${i}ms'`))
32}
33
34/**
35 * Scales `statement_timeout` to the expected row-count work.

Callers 15

withLockedTableFunction · 0.90
createTableFunction · 0.90
restoreTableFunction · 0.90
updateWorkflowGroupFunction · 0.90
deleteWorkflowGroupFunction · 0.90
insertOrderedRowFunction · 0.90
deleteOrderedRowFunction · 0.90
deleteOrderedRowsByIdsFunction · 0.90
deletePageByIdsFunction · 0.90
updatePageByIdsFunction · 0.90
batchInsertRowsWithTxFunction · 0.90

Calls 1

executeMethod · 0.65

Tested by

no test coverage detected