From a6a12dae10658a1fa7120ad39702c07137143954 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 9 Jun 2021 13:31:22 +0200 Subject: [PATCH] Fix run committed transation --- server/helpers/database-utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts index 240b18033..b5dc70c17 100644 --- a/server/helpers/database-utils.ts +++ b/server/helpers/database-utils.ts @@ -108,7 +108,9 @@ function setAsUpdated (table: string, id: number, transaction?: Transaction) { // --------------------------------------------------------------------------- function runInReadCommittedTransaction (fn: (t: Transaction) => Promise) { - return sequelizeTypescript.transaction(t => fn(t)) + const options = { isolationLevel: Transaction.ISOLATION_LEVELS.READ_COMMITTED } + + return sequelizeTypescript.transaction(options, t => fn(t)) } function afterCommitIfTransaction (t: Transaction, fn: Function) {