mirror of
https://github.com/documenso/documenso.git
synced 2026-07-24 00:43:40 +10:00
perf: set global prisma transaction timeouts and reduce transaction scope (#2607)
Configure default transaction options (5s maxWait, 10s timeout) on the PrismaClient instead of per-transaction overrides. Move side effects like email sending, webhook triggers, and job dispatches out of $transaction blocks to avoid holding database connections open during network I/O. Also extracts the direct template email into a background job and fixes a bug where prisma was used instead of tx inside a transaction.
This commit is contained in:
@@ -1389,7 +1389,7 @@ export const ApiContractV1Implementation = tsr.router(ApiContractV1, {
|
||||
throw new Error('Invalid page number');
|
||||
}
|
||||
|
||||
const recipient = await prisma.recipient.findFirst({
|
||||
const recipient = await tx.recipient.findFirst({
|
||||
where: {
|
||||
id: Number(recipientId),
|
||||
envelopeId: envelope.id,
|
||||
|
||||
Reference in New Issue
Block a user