aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-09 13:31:22 +0200
committerChocobozzz <me@florianbigard.com>2021-06-09 13:31:22 +0200
commita6a12dae10658a1fa7120ad39702c07137143954 (patch)
tree81b6b6663541f6120918a696569c1083b5bd30b6
parent5d6395af72e01ba7c4393b485b7089bcb33e0155 (diff)
downloadPeerTube-a6a12dae10658a1fa7120ad39702c07137143954.tar.gz
PeerTube-a6a12dae10658a1fa7120ad39702c07137143954.tar.zst
PeerTube-a6a12dae10658a1fa7120ad39702c07137143954.zip
Fix run committed transation
-rw-r--r--server/helpers/database-utils.ts4
1 files changed, 3 insertions, 1 deletions
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) {
108// --------------------------------------------------------------------------- 108// ---------------------------------------------------------------------------
109 109
110function runInReadCommittedTransaction <T> (fn: (t: Transaction) => Promise<T>) { 110function runInReadCommittedTransaction <T> (fn: (t: Transaction) => Promise<T>) {
111 return sequelizeTypescript.transaction(t => fn(t)) 111 const options = { isolationLevel: Transaction.ISOLATION_LEVELS.READ_COMMITTED }
112
113 return sequelizeTypescript.transaction(options, t => fn(t))
112} 114}
113 115
114function afterCommitIfTransaction (t: Transaction, fn: Function) { 116function afterCommitIfTransaction (t: Transaction, fn: Function) {