From cc702eeabfb9244d25038fa4e119a6dbab5ec361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Alves?= Date: Fri, 23 Oct 2026 04:08:00 +0100 Subject: [PATCH] fix(archive): give rebuildDirectory's transaction room to acquire a connection (BIT-31703) Prisma's default maxWait is 2s; under brief pool contention (e.g. assignGalleries holding a connection under its advisory lock) rebuildDirectory's $transaction could fail to even start with 'Unable to start a transaction in the given time', despite already allowing 60s for the transaction body itself via timeout. --- apps/api/src/archive/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/src/archive/service.ts b/apps/api/src/archive/service.ts index 4a43734..f45abe8 100644 --- a/apps/api/src/archive/service.ts +++ b/apps/api/src/archive/service.ts @@ -1384,7 +1384,7 @@ export class ArchiveService { where: { id: sourceId, OR: [{ directoryDirtyAt: null }, { directoryDirtyAt: { lte: started } }] }, data: { directoryBuiltAt: new Date(), directoryDirtyAt: null }, }); - }, { timeout: 60_000 }); + }, { timeout: 60_000, maxWait: 60_000 }); return rows.length; }